chrome.runtime.onInstalled.addListener(() => { chrome.declarativeContent.onPageChanged.removeRules(undefined, () => { chrome.declarativeContent.onPageChanged.addRules([{ conditions: [ new chrome.declarativeContent.PageStateMatcher({ pageUrl: { }, }) ], actions: [ new chrome.declarativeContent.ShowPageAction() ] }]); }); }); chrome.runtime.onMessage.addListener((request, sender, sendResponse) => { let icons = request.killingStickies ? { "16": "images/ASK_on_16.png", "32": "images/ASK_on_32.png", "48": "images/ASK_on_48.png", "128": "images/ASK_on_128.png" } : { "16": "images/ASK_off_16.png", "32": "images/ASK_off_32.png", "48": "images/ASK_off_48.png", "128": "images/ASK_off_128.png" }; chrome.pageAction.setIcon({ path: icons, tabId: sender.tab.id }); });