Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chrome window dimensions not obeyed #256

Open
skorokithakis opened this issue Oct 22, 2024 · 10 comments
Open

Chrome window dimensions not obeyed #256

skorokithakis opened this issue Oct 22, 2024 · 10 comments

Comments

@skorokithakis
Copy link

I'm trying the following command on version 3.0.5:

❯ gowitness scan --chrome-window-x 384 --chrome-window-y 640 --screenshot-path . --write-none single --screenshot-format png --url https://sensepost.com
2024/10/22 15:41:12 ERROR: unhandled node event *dom.EventScrollableFlagUpdated
2024/10/22 15:41:15 INFO result 🤖 target=https://sensepost.com status-code=200 title=":: Orange Cyberdefense ::" have-screenshot=true

But the result is 500x501 pixels:

https---sensepost com

What am I doing wrong?

@leonjza
Copy link
Member

leonjza commented Oct 22, 2024

Command invocation is fine. We don't have much control over how it's handled from a gowitness perspective. The values are passed to the drivers as is. chromedp and gorod.

Unrelated to this, but this line implies you have an outdated cdproto dependency. Make sure you have the latest gowitness.

2024/10/22 15:41:12 ERROR: unhandled node event *dom.EventScrollableFlagUpdated

@skorokithakis
Copy link
Author

I seem to:

❯ gowitness version
               _ _                   
 ___ ___ _ _ _|_| |_ __ ___ ___ ___ 
| . | . | | | | |  _|  | -_|_ -|_ -|
|_  |___|_____|_|_||_|_|___|___|___|
|___|    v3, with <3 by @leonjza

gowitness: 3.0.5
git hash: 6b0000e
build env: go1.23.2_linux/arm64
build time: 2024-10-21T19:22:14Z

Can I upgrade cdproto somehow? I didn't compile gowitness from source, I'm just using the binary release from GH.

@leonjza
Copy link
Member

leonjza commented Oct 22, 2024

Not without a recompilation. I bumped the deps now, will land in a next release in the future.

@skorokithakis
Copy link
Author

I compiled from source but the image is still 500x501:

❯ gowitness version
               _ _                   
 ___ ___ _ _ _|_| |_ __ ___ ___ ___ 
| . | . | | | | |  _|  | -_|_ -|_ -|
|_  |___|_____|_|_||_|_|___|___|___|
|___|    v3, with <3 by @leonjza

gowitness: 3.0.5
git hash: dev
build env: dev
build time: dev

Do you have any tips? I know this might be something with the driver, but I'm stuck.

@leonjza
Copy link
Member

leonjza commented Oct 22, 2024

I don't. Like I mentioned, this is passed to the driver. It will require deeper digging into the implementation to debug.

That said, it does seem to honour it somewhat, just not exactly as expected.

@skorokithakis
Copy link
Author

Thank you, I'm looking into this. Is there any way to see which driver executable gowitness is using? Then I'll know where to look.

@leonjza
Copy link
Member

leonjza commented Oct 22, 2024

-D flag will surface some debugging info that may help in tracing execution flow. Beyond that you need to start editing source :)

@AiPals

This comment was marked as spam.

@leonjza
Copy link
Member

leonjza commented Oct 27, 2024

@AiPals please don't post LLM generated content here. The relevant dependency has already been updated and will land in a next release.

@BenAlanSouthall
Copy link

I'm not sure if it's relevant of helpful, but I had previously been using the 11ty screenshot capture tool here. I'm generating social cards for link previews, and the dimension and aspect ratio requirements there are quite strict, as well as needing to make sure I capture the full page and avoid any cropping.

I haven't dug into what's happening in the backend there, but the opengraph size has always managed to render the exact size needed. I'm trying gowitness though as caching and timeout issues mean it's just easier to spin up a container and do locally. For now at least I can use --screenshot-fullpage and crop with imagemagick or something, ad the dimensions appear to be okay there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants