Update messageHandler.js
This commit is contained in:
parent
0d0c487275
commit
a3cbdb6908
1 changed files with 14 additions and 0 deletions
|
@ -20,6 +20,9 @@ const messageHandler = {
|
|||
case "resetSync":
|
||||
response = sync.resetSync();
|
||||
break;
|
||||
case "resetPageAction":
|
||||
response = assignManager.resetPageAction();
|
||||
break;
|
||||
case "deleteContainer":
|
||||
response = backgroundLogic.deleteContainer(m.message.userContextId);
|
||||
break;
|
||||
|
@ -196,6 +199,17 @@ const messageHandler = {
|
|||
});
|
||||
}, {urls: ["<all_urls>"], types: ["main_frame"]});
|
||||
|
||||
browser.tabs.onUpdated.addListener((tabId) => {
|
||||
// check if the page action is enabled right away to avoid flashing
|
||||
browser.storage.local.get({ pageActionEnabled: true }).then(({ pageActionEnabled }) => {
|
||||
if (pageActionEnabled) {
|
||||
browser.pageAction.show(tabId);
|
||||
}
|
||||
}).catch(e => {
|
||||
throw e;
|
||||
});
|
||||
}, { properties: ["status"] });
|
||||
|
||||
browser.tabs.onCreated.addListener((tab) => {
|
||||
// lets remember the last tab created so we can close it if it looks like a redirect
|
||||
this.lastCreatedTab = tab;
|
||||
|
|
Loading…
Add table
Reference in a new issue