function onCaptured(imageUri) {
console.log(imageUri);
}
function onError(error) {
console.log(`Error: ${error}`);
}
browser.browserAction.onClicked.addListener(() => {
let capturing = browser.tabs.captureTab();
capturing.then(onCaptured, onError);
});tabs.captureTab() / notebook
tabs.captureTab()
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.