amit
amit

Reputation: 10261

generate browser window screenshot

I have to work with multiple pages (tabs) at once and need to see how the different pages look like at any one instance. Is it possible to take screen shots of open tab in Firefox/Chrome via Javascript?

Upvotes: 0

Views: 526

Answers (2)

andi
andi

Reputation: 1001

If you like to do it programmatically with WebKit you could use:

http://www.phantomjs.org

Here is how it works:

PhantomJS is a command-line tool that packs and embeds WebKit. Literally it acts like any other WebKit-based web browser, except that nothing gets displayed to the screen (thus, the term headless). In addition to that, PhantomJS can be controlled or scripted using its JavaScript API.

Here is an example:

$>./panthomjs.exe rasterize.js http://www.google.com google.png

Upvotes: 1

jldupont
jldupont

Reputation: 96844

On Chrome, use the Aviary extension: if you require programmatic access, you could fork from the said extension to provide an API.

There is also the captureVisibleTab tabs function available through Chrome extension: it does all the work (almost ;-) for you.

Upvotes: 2

Related Questions