diff options
| author | auric <auric7@protonmail.com> | 2025-09-11 18:00:59 -0500 |
|---|---|---|
| committer | auric <auric7@protonmail.com> | 2025-09-11 18:00:59 -0500 |
| commit | 38a82bc7e3569b7502a652c9f3fea37a017c0ccb (patch) | |
| tree | db4551326bf98c02a099c5df213a1dff047c2ca8 /browsers/firefox/extension/background.js | |
| parent | 61eaeb858dbe12dcf1596b725a3bab1df66569f4 (diff) | |
Remove browsers
Diffstat (limited to 'browsers/firefox/extension/background.js')
| -rw-r--r-- | browsers/firefox/extension/background.js | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/browsers/firefox/extension/background.js b/browsers/firefox/extension/background.js deleted file mode 100644 index df0ee80..0000000 --- a/browsers/firefox/extension/background.js +++ /dev/null @@ -1,34 +0,0 @@ -let port = browser.runtime.connectNative("accent_color"); -let current = null; - -function broadcast(color) { - browser.tabs.query({}).then(tabs => { - for (let tab of tabs) { - browser.tabs.sendMessage(tab.id, {color}).catch(() => {}); - } - }); - browser.theme.update({colors: {toolbar: color}}); -} - -port.onMessage.addListener(msg => { - if (msg.color && msg.color !== current) { - current = msg.color; - broadcast(current); - } -}); - -function poll() { - try { - port.postMessage({query: "color"}); - } catch (e) { - // ignore - } -} -setInterval(poll, 1000); -poll(); - -browser.runtime.onMessage.addListener((msg, sender) => { - if (msg.request === "color") { - return Promise.resolve({color: current}); - } -}); |
