diff options
| author | auric <104602845+ihateamongus@users.noreply.github.com> | 2025-09-11 15:13:57 -0500 |
|---|---|---|
| committer | auric <104602845+ihateamongus@users.noreply.github.com> | 2025-09-11 15:13:57 -0500 |
| commit | 6207d8a75e40aa76008edaffbbe138bbc9f6baa4 (patch) | |
| tree | 0ab78ec4155721ae8571fdcac435c9b84e232ca9 /browsers/firefox/extension/content.js | |
| parent | 2d10fcf6bb85732819385f20a9bc13c50036c0f7 (diff) | |
Add dynamic Firefox accent color extension
Diffstat (limited to 'browsers/firefox/extension/content.js')
| -rw-r--r-- | browsers/firefox/extension/content.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/browsers/firefox/extension/content.js b/browsers/firefox/extension/content.js new file mode 100644 index 0000000..118c7ee --- /dev/null +++ b/browsers/firefox/extension/content.js @@ -0,0 +1,15 @@ +function apply(color) { + document.documentElement.style.setProperty("--accent-color", color); +} + +browser.runtime.onMessage.addListener(msg => { + if (msg.color) { + apply(msg.color); + } +}); + +browser.runtime.sendMessage({request: "color"}).then(msg => { + if (msg && msg.color) { + apply(msg.color); + } +}); |
