[javascript] How to screenshot website in JavaScript client-side / how Google did it? (no need to access HDD)

I'm working on web application that needs to render a page and make a screenshot on the client (browser) side.

I don't need the screenshot to be saved on the local HDD though, just kept it in RAM and send it to the application server later.

I researched:

  1. BrowserShots alike services...
  2. Mechanized browsers...
  3. wkhtmltoimage...
  4. Python WebKit2PNG...

But none of those gives me all I need, which is:

  1. Processing at browser side (generate screenshot of page). Don't need to be saved on HDD! Just...
  2. ...send image to Server for further processing.
  3. Capturing whole page (not only visible part)

Eventually I came upon Google's Feedback Tool (click "feedback" on YouTube footer to see this). It contains JavaScript for JPG encoding and two other huge scripts which I can't determine what exactly they do...

But it's processed on the Client side - otherwise there would be no point putting this huge JPEG encoder in the code!

Anyone have any idea how did they made it / how I can make it?

Here is an example of the feedback (report a bug on some screens)

Feedback/report bug example

This question is related to javascript screenshot capture google-search

The answer is


"Using HTML5/Canvas/JavaScript to take screenshots" answers your problem.

You can use JavaScript/Canvas to do the job but it is still experimental.


I needed to snapshot a div on the page (for a webapp I wrote) that is protected by JWT's and makes very heavy use of Angular.

I had no luck with any of the above methods.

I ended up taking the outerHTML of the div I needed, cleaning it up a little (*) and then sending it to the server where I run wkhtmltopdf against it.

This is working very well for me.

(*) various input devices in my pages didn't render as checked or have their text values when viewed in the pdf... So I run a little bit of jQuery on the html before I send it up for rendering. ex: for text input items -- I copy their .val()'s into 'value' attributes, which then can be seen by wkhtmlpdf


Examples related to javascript

need to add a class to an element How to make a variable accessible outside a function? Hide Signs that Meteor.js was Used How to create a showdown.js markdown extension Please help me convert this script to a simple image slider Highlight Anchor Links when user manually scrolls? Summing radio input values How to execute an action before close metro app WinJS javascript, for loop defines a dynamic variable name Getting all files in directory with ajax

Examples related to screenshot

How to make a movie out of images in python Unable to capture screenshot. Prevented by security policy. Galaxy S6. Android 6.0 How to prevent Screen Capture in Android Using ADB to capture the screen How to save the contents of a div as a image? How to capture the screenshot of a specific element rather than entire page using Selenium Webdriver? iOS Detection of Screenshot? Take a full page screenshot with Firefox on the command-line Screenshot sizes for publishing android app on Google Play Take screenshots in the iOS simulator

Examples related to capture

Capture Image from Camera and Display in Activity How to screenshot website in JavaScript client-side / how Google did it? (no need to access HDD) Capturing image from webcam in java? What is ' and why does Google search replace it with apostrophe? How to find Google's IP address? How can I add a Google search box to my website? How do search engines deal with AngularJS applications? How to screenshot website in JavaScript client-side / how Google did it? (no need to access HDD) How can I use a search engine to search for special characters? What are the alternatives now that the Google web search API has been deprecated? What database does Google use?