Here‘s a practical application that turns Firefox into a screenshot server. It lets you request e.g.
http://localhost:4242/screenshot/http://en.wikipedia.org and receive a PNG screenshot of Wikipedia homepage. (Instructions to run it are at the bottom.)
Features and things to note:
- Every page is loaded in a new tab, meaning that multiple screenshots can be requested concurrently.
- You can have MozRepl listen to outside requests and thus have the server run on a machine (or machines) other than the one requesting screenshots.
.../getmail/http://mail.google.com?user=foo&password=bar, and so on, shouldn’t be too hard.
This is no finished product but it should give a hint of the possibilities. Known issues: since it takes the screenshot upon DOM load event, pages that use the same event to build sizeable portions of the document (such as iGoogle) might turn out incomplete or just white. Also, Firefox 3.1 seems to hang when the same browser instance is both the requester and the receiver of the screenshot (ok, not the most useful scenario, but still).
To try it:
- Get MozRepl, whether devel or stable branch doesn’t matter.
- Copy the source of the screenshot server to a file (e.g.
- In about:config, set
extensions.mozrepl.initUrlto the URL of that file, e.g.
file:///home/foo/mozrepl-init.js. (This file gets read whenever a new MozRepl session is started.)
- In about:config, also set
Tools → MozRepl → Startfrom the menu to start MozRepl.
- Point wget (or curl, or another browser) to Firefox with:
$ wget http://localhost:4242/screenshot/http://en.wikipedia.org