diff options
author | Nicholas Tay <nick@windblume.net> | 2023-02-22 21:23:02 +0100 |
---|---|---|
committer | Nicholas Tay <nick@windblume.net> | 2023-02-22 21:23:02 +0100 |
commit | 306489f9e8a23b482235d7e78fa8788ee5244cd1 (patch) | |
tree | 512061bec0bbfd9ab15633152f9d2c29b97b4389 | |
parent | ebe23c4d29ece449a8847128300d783714d945f4 (diff) | |
download | certain-306489f9e8a23b482235d7e78fa8788ee5244cd1.tar.gz certain-306489f9e8a23b482235d7e78fa8788ee5244cd1.tar.bz2 certain-306489f9e8a23b482235d7e78fa8788ee5244cd1.zip |
Reset tabs if config changed
-rw-r--r-- | background.js | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/background.js b/background.js index 4d94e69..1f0225c 100644 --- a/background.js +++ b/background.js @@ -79,10 +79,16 @@ function updateCerts() { const getting = browser.storage.sync.get("certs"); getting.then(saved => { certs = saved.certs; - console.log("certs=" + certs) + // Reset all tab data + browser.tabs.query({}).then(tabs => { + for (let tab of tabs) { + browser.browserAction.setIcon({ tabId: tab.id }); + browser.browserAction.setBadgeText({ text: "", tabId: tab.id }); + } + }, console.error); }, console.error) } // Listen to config change for certs list -browser.storage.local.onChanged.addListener(() => updateCerts()); +browser.storage.sync.onChanged.addListener(() => updateCerts()); // Initial config fetch updateCerts();
\ No newline at end of file |