samedi 29 novembre 2014

How to get a screenshot of an external website in a Chrome Extension [duplicate]



This question already has an answer here:




I am working on a web history/bookmark browser extension for Chrome and I want to display each individual history/bookmark item as a screenshot (png preferably) of their respective url.


My documentation lead me to html2canvas, but in order to use it I would need to implement my own PHP proxy server, as per this example, where in the following line of code



`$.getJSON("http://html2canvas.appspot.com/query?callback=?", { xhr2:false, url:urlParts.href }, function(html) {`


the string should be replaced by my own proxy server's url.


This wouldn't be a problem, but I don't want to have this dependency. There already is a Chrome extension called All Seeing Eye, but what I understand is that it starts recording browsing data as soon as its installed and it does not use existing history data.


Is there any way of taking screenshots of websites in a Chrome extension dynamically, without having to continuously record data, or resorting to a proxy server ?


Edit: The answers provided in the similar question would force me to go down the way of the extension All Seeing Eye and capture newly opened tabs, caching the images, then bringing them up when needed. What I'm asking for is a way to simply create a screenshot from a URL, not an open tab.





Aucun commentaire:

Enregistrer un commentaire