Since you use this in Chrome extensions, the tabs API has a captureVisibleTab method that allows you to capture the visible area of ββthe currently selected tab in the specified window.
To use this, you simply add βtabsβ to the manifest permissions . And from your background page or popup (or any other extension page), you simply call this method as follows:
chrome.tabs.captureVisibleTab(null, {}, function (image) {
You can manage the property by adding {quality: 50} and change the format too, everything is described in the documents mentioned above.
The beauty of HTML5, you can change this image using HTML5 Canvas, you can very easily manipulate, transform, modify, clip, anything you want!
Hope this is what you are looking for! Happy New Year!
Mohamed Mansour Jan 01 '10 at 16:52 2011-01-01 16:52
source share