
selector Accepts a CSS selector and captures only that element and its descendants. For unusually long (or wide) pages, this can cause problems like crashing, not capturing all of the page, or just failing to capture anything at all. fullpage Captures the entire page, not just the portion of the page visible in the browser’s viewport. See the original article for more details. Values above 1 yield “zoomed-in” images values below 1 create “zoomed-out“ results. dpr The Device Pixel Ratio (DPR) of the captured image. You can use any number, not just integers. delay The time in seconds to wait before taking the screenshot handy if you want to pop open a menu or invoke a hover state for the screenshot. Prevents saving to a file unless you use the -file option to force file-writing. So the list of :screenshot options as of late August 2018 is: -clipboard Copies the image to your OS clipboard for pasting into other programs.

There are plans to add uploading to Firefox Screenshots as a replacement for the old Imgur option, but as of this writing, that’s still in the future. From there, everything is the same as I wrote in 2015, with the exception that the -imgur and -chrome options no longer exist. Once you’re in the Web Console, you can type :sc and then hit Tab to autocomplete :screenshot. An image I captured by typing :screenshot -dpr 0.5 in the Web Console It’s available in the Web Console ( ⌥⌘K or Tools → Web Developer → Console). Well, the GCLI is gone now, but the coders at Mozilla have brought command-line screenshotting back with :screenshot, currently available in Firefox Nightly and Firefox Dev Edition. usr/bin/firefox -screenshot firefox-ss1.Back in 2015, I wrote about Firefox’s screenshot utility, which used to be a command in the GCLI. here is an example command capturing a screenshot of and saving the file as firefox-ss1.png in the current directory.

You can use the which command to find the location of the Firefox executable just like we did above. NOTE: If you omit the filename the file will be saved in the current working directory as screenshot.png. The basic syntax for take a screenshot with Firefox from the command line is: -screenshot "path/to/save/filename.png" "" The other advantage of using Firefox over Chrome, is that Firefox takes a screenshot of the full web page by default. Firefox includes a handy -screenshot option that automatically puts you in headless mode. Taking a screenshot with Firefox from the command is very straight forward. Taking Screenshots with Firefox from the Linux Command Line See the Links and Resources section below for a complete list of command line options. You can use them to get the exact screenshot you want. There are a lot of command line options when using Chrome or Chromium. Here is a sample screenshot taken with the above command. Now that we have the location, we simply run chrome with some options like so: /usr/bin/google-chrome -headless -screenshot="/home/mcherisi/chrome-ss1.png" "" We can do this by using the which command like so: ~]$ which google-chrome The first step is to find the location of the google-chrome executable. NOTE: If you are using Chromium simply replace google-chrome with chromium-browser in the following commands. Here is the basic syntax of the command: -headless -screenshot="" ""

Taking a screenshot of a URL in Google Chrome from the command line is fairly easy. Taking Screenshots with Google Chrome / Chromium from Linux Command Line During headless operation, the browser will not attempt to create a window because it assumes there is no GUI. The term "headless" or "headless mode" basically means using a system or application that does not have a monitor or graphical user interface (GUI). This can come in handy when creating scripts that take screenshots of a URL without user interaction as well as loading metadata (e.g. Both Google Chrome and Firefox have the ability to take screenshots from the Linux command line.
