This repository has been archived on 2024-07-03. You can view files and clone it, but cannot push or open issues or pull requests.
lunk/chrome-extension/popup/index.js

11 lines
311 B
JavaScript
Raw Permalink Normal View History

2021-06-11 00:47:16 +02:00
chrome.storage.sync.get('globalOnOffSwitch', ({globalOnOffSwitch}) => {
document.getElementById('onOffSwitch').checked = globalOnOffSwitch ?? true;
});
document
.getElementById('onOffSwitch')
.addEventListener(
'change',
e => chrome.storage.sync.set({'globalOnOffSwitch': e.target.checked})
);