5 ms·
For anyone who might not be aware, Chrome also has the ability to save screenshots from the command line using: chrome --headless --screenshot="path/to/save/scr
by xnx 2y ago
For anyone who might not be aware, Chrome also has the ability to save screenshots from the command line using:
chrome --headless --screenshot="path/to/save/screenshot.png" --disable-gpu --window-size=1280,720 "https://www.example.com https://www.example.com"
- martinbaun 2y agoOh man, I needed this so many times didn't even think of doing it like this. I tried using Selenium and all different external services. Thank you! Works in chromium as well.
- azhenley 2y agoVery nice, I didn't know this. I used pyppeteer and selenium for this previously which seemed excessive.
- Onavo 2y agoWhat features won't work without GPU?
- xnx 2y ago[flagged]
- dingnuts 2y agooh good an AI summary with none of the facts checked, literally more useless than the old lmgtfy and somehow more rude "here's some output that looks relevant to your question but I couldn't even be arsed to look any of it up, or copy paste it, or confirm its validity"
- kylecazar 2y agoThis flag isn't valid anymore in the new chrome headless. Disable GPU doesn't exist unless your on the old version (and then, it was meant as a workaround for Windows users only). I've used this via selenium not too long ago
- cmgriffing 2y agoQuick note: when trying to do full page screenshots, Chrome does a screenshot of the current view, then scrolls and does another screenshot. This can cause some interesting artifacts when rendering pages with scroll behaviors. Firefox does a proper full page screenshot and even allows you to set a higher DPS value. I use this a lot when making video content. Check out some of the args in FF using: `:screenshot --help`
- wereHamster 2y agoThat's not the behavior I'm seeing (with Puppeteer). Any elements positioned relative to the viewport stay within the area specified by screen size (eg. 1200x800) which is usually the top of the page. If the browser would scroll down these would also move down (and potentially appear multiple times in the image). Also intersection observers which are further down on the page do not trigger when I do a full-page screenshot (eg. an element which starts animation when it enters into the viewport).
- deleted 2y ago[deleted]
- genewitch 2y agobravo for puppeteer, i guess? "singlefile" is the only thing i've ever seen not do weird artifacts in the middle of some site renders, or, like on reddit, just give up rendering comments and render blank space instead until the footer. anyhow i've been doing this exact thing for a real long time, e.g. https://raw.githubusercontent.com/genewitch/opensource/refs/heads/master/screenshot.cgi https://raw.githubusercontent.com/genewitch/opensource/refs/... using bash to return json to some stupid chat service we were running
- xg15 2y agoI mean, if you have some of those annoying "hijack scrolling and turn the page into some sort of interactive animation experience" sites, I don't think "full page" would even be well-defined.
- 2y ago
- input_sh 2y agoFirefox equivalent: firefox -screenshot file.png https://example.com --window-size=1280,720 A bit annoyingly, it won't work if you have Firefox already open.
- cmgriffing 2y agoLOL, you and I posted very similar replies at the same time.
- blueflow 2y ago> it won't work if you have Firefox already open now try and go ahead how you could isolate these instances so they cannot see each other. this leads into a rabbit hole of bad design.
- yjftsjthsd-h 2y ago> now try and go ahead how you could isolate these instances so they cannot see each other. this leads into a rabbit hole of bad design. Okay, done: PROFILEDIR="$(mktemp -d)" firefox --no-remote --profile "$PROFILEDIR" --screenshot $PWD/output.png https://xkcd.com rm -r "$PROFILEDIR" What's the rabbit hole?
- blueflow 2y agoWhats with the dbus interface?
- yjftsjthsd-h 2y agoWhat? (If you're trying to point out that two firefoxes are capable of talking to each other via system IPC, then yes, fully isolating any two programs on the same machine requires at least containers but probably full VMs, which has nothing to do with Firefox itself, and you'd need to explain why in this situation we should care)
- UnlockedSecrets 2y agoDoes it work if you use a different profile with -p?
- hulitu 2y ago> Chrome also has the ability to save screenshots Too bad that no browser is able to print a web page.
- antifarben 2y agoDoes anyone know whether this would also be possible with Firefox, including explicit extensions (i.e. uBlock) and explicit configured block lists or other settings for these extensions?