mirror of
https://github.com/LBRYFoundation/Watch-on-LBRY.git
synced 2025-08-23 17:47:26 +00:00
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.
7 lines
271 B
JavaScript
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" });
|
|
});
|