diff options
| author | 2024-01-03 12:59:25 +0100 | |
|---|---|---|
| committer | 2024-01-03 12:59:25 +0100 | |
| commit | b69610285c11ec3251c78c31f60d8a9e92db6e0d (patch) | |
| tree | a64fd8b91e9ba0a11b7e6d3ee983781f83e3d4d1 /bg.js | |
| download | floating-cats-extension-b69610285c11ec3251c78c31f60d8a9e92db6e0d.tar.gz floating-cats-extension-b69610285c11ec3251c78c31f60d8a9e92db6e0d.tar.xz floating-cats-extension-b69610285c11ec3251c78c31f60d8a9e92db6e0d.zip | |
Floating Cats 0.1
Diffstat (limited to 'bg.js')
| -rw-r--r-- | bg.js | 13 |
1 files changed, 13 insertions, 0 deletions
| @@ -0,0 +1,13 @@ | |||
| 1 | "use strict"; | ||
| 2 | |||
| 3 | if (typeof(browser) == "undefined") { | ||
| 4 | globalThis.browser = chrome; | ||
| 5 | } | ||
| 6 | |||
| 7 | browser.browserAction.onClicked.addListener(async () => { | ||
| 8 | browser.runtime.openOptionsPage(); | ||
| 9 | |||
| 10 | const enabled = (await browser.storage.sync.get("enabled")).enabled; | ||
| 11 | console.log(enabled); | ||
| 12 | await browser.storage.sync.set({ enabled: !enabled }); | ||
| 13 | }); | ||