Fix for popup with polyfill

This commit is contained in:
varjolintu 2017-09-12 15:27:18 +03:00
parent 68e41d65c6
commit db603a4c66

View file

@ -46,6 +46,15 @@ page.initOpenedTabs = function() {
for (const i of tabs) {
page.createTabEntry(i.id);
}
// set initial tab-ID
browser.tabs.query({ "active": true, "currentWindow": true }).then((tabs) => {
if (tabs.length === 0) {
return; // For example: only the background devtools or a popup are opened
}
page.currentTabId = tabs[0].id;
browserAction.show(null, tabs[0]);
});
});
}