I’m running this in my content script:
console.log("here");
browser.tabs.getCurrent()
.then(getTab)
.catch(reportTabError);
function reportTabError(error) {
console.error(`Could not process: ${error}`);
}
function getTab(tabInfo){
console.log("here 2");
window.currentTabId = tabInfo.id;
}
It seems that getTab
is never fired. Also tried this one, same result:
console.log("here");
browser.tabs.query({currentWindow: true, active: true})
.then(getTab)
.catch(reportTabError);
function reportTabError(error) {
console.error(`Could not process: ${error}`);
}
function getTab(tabInfo){
console.log(tabInfo.id);
//window.currentTabId = tabInfo.id;
}