Watch-on-LBRY/scripts/storageOnChanged.js
Yamboy1 464150afac See commit desc.
Big changes here.
- I've moved all of the scripts to individual
files in the `scripts` folder.
- I've updated all the code to ES7.
- The extension stores the state in browser
storage now, and it persists.
- The extension has a default state of on.
2020-01-11 23:07:55 +13:00

7 lines
271 B
JavaScript

chrome.storage.onChanged.addListener((changes, areaName) => {
if (areaName !== "local") return;
if (!changes.enabled) return;
const { newValue } = changes.enabled;
console.log(newValue);
chrome.browserAction.setBadgeText({ text: newValue ? "ON" : "OFF" });
});