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.
8 lines
376 B
JavaScript
8 lines
376 B
JavaScript
chrome.runtime.onInstalled.addListener(() => {
|
|
chrome.storage.local.get('enabled', ({ enabled }) => {
|
|
if (enabled === null || enabled === undefined) enabled = true;
|
|
chrome.storage.local.set({ enabled });
|
|
// have to set this manually as the trigger doesn't work for `onInstalled`
|
|
chrome.browserAction.setBadgeText({ text: enabled ? "ON" : "OFF" });
|
|
});
|
|
});
|