Omar Abid Omar Abid - 5 months ago 35x
Bash Question

Take a full page screenshot with Firefox

I'm running Firefox on a Xvfb in a VPS. What I want to do is to take a full page screenshot of the page.

I can redirect Firefox to particular page using


and take a screenshot (inside X) using ImageMagick

import root -window output.jpg

The problem is, most of the page need scrolling and I can't know the height beforehand.

The other way is to pick a very big height (like 4000px) and then process the image and remove the useless part. But that's unnecessary processing.

I found many Firefox add-ons, but I'm looking for a solution that can be programmed using the Shell Command line.

Edit: I ended up writing my own FireFox extension for doing this.


Since Firefox 16 you can press shift-F2 or go to Tools > Web Developer > Developer Toolbar to open a command line. Write:


and press Intro in order to take a screeshot.

To fully answer the question, you can even save the whole page, not only the visible part of it:

screenshot --fullpage

And to copy the screenshot to clipboard, use --clipboard option:

screenshot --clipboard --fullpage

Firefox 18 changes the way arguments are passed to commands, you have to add "--" before them.

You can find some documentation and the full list of commands here.

PS. The screenshots are saved into the downloads directory by default.