Take screenshot in chrome extension
If you are working on a Chrome extension and want to take a screenshot if the background webpage use the following code.
chrome.tabs.captureVisibleTab(null, {}, function (image) {
console.log(image); //the image variable is a base64 encoded image which you should be able to load in either canvas or src attribute of an image.
});
Written by Suman Paul
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Chrome
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#