function logTabs(windowInfo) {
for (const tabInfo of windowInfo.tabs) {
console.log(tabInfo.url);
}
}
function onError(error) {
console.error(`Error: ${error}`);
}
browser.browserAction.onClicked.addListener((tab) => {
browser.windows.getCurrent({ populate: true }).then(logTabs, onError);
});windows.getCurrent() / notebook
windows.getCurrent()
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.