Search code examples
javascripthtmlcanvasscreenshot

How to take a screenshot of a web page by using Javascript


I need to capture the currently active web page as a screenshot. I've already tried html2canvas & GrabzIt but the problem is that I need a precise screenshot of the page I am on currently. The reason why I don't want to use html2canvas is because it does not always return a good version of a screenshot (not rendering properly) and I don't want to use GrabzIt because it's not free.

Do any of you have an idea how to accomplish this either by using javascript/java/flash? Any option will do as long as it works...

P.S. I'm currently capturing screenshots with my addon for Firefox by using the function that firefox offers : context.drawWindow and now i want to make it available online.

Thanks a lot!


Solution

  • In the end, I ended up using server side generation of screenshots with phantomjs. Found it the most reliable in my scenario and it takes pretty decent screenshots.