So I want wrote some code which will allow me to take a screenshot of the page when a button is pressed on my website. The code works, but the only problem is that I have to click on the chrome extension first, and then I can click on the button for it to take the screenshot. I guess that's because the active tab is not invoked. Any ideas? This error does not occur in Ubuntu and Mac, only windows.
This is the error: Unchecked runtime.lastError while running tabs.captureVisibleTab: The 'activeTab' permission is not in effect because this extension has not been in invoked.
Chrome version
52.0.2743.116 m (64-bit)
My manifest.json
"permissions": [
"tabs",
"activeTab",
"tabCapture",
"<all_urls>",
"privacy"
]
background.js
chrome.tabs.captureVisibleTab(self.windowId, {
'format': 'png'
}, function(dataURI) {
....
});