11 lines
311 B
JavaScript
11 lines
311 B
JavaScript
|
|
||
|
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})
|
||
|
);
|