summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Tay <nick@windblume.net>2023-02-22 21:23:02 +0100
committerNicholas Tay <nick@windblume.net>2023-02-22 21:23:02 +0100
commit306489f9e8a23b482235d7e78fa8788ee5244cd1 (patch)
tree512061bec0bbfd9ab15633152f9d2c29b97b4389
parentebe23c4d29ece449a8847128300d783714d945f4 (diff)
downloadcertain-306489f9e8a23b482235d7e78fa8788ee5244cd1.tar.gz
certain-306489f9e8a23b482235d7e78fa8788ee5244cd1.tar.bz2
certain-306489f9e8a23b482235d7e78fa8788ee5244cd1.zip
Reset tabs if config changed
Diffstat (limited to '')
-rw-r--r--background.js10
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