2019-10-07 13:59:31 +02:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
let disableNitter = document.querySelector('#disableNitter');
|
|
|
|
let disableInvidious = document.querySelector('#disableInvidious');
|
|
|
|
|
|
|
|
chrome.storage.sync.get(
|
|
|
|
['disableNitter', 'disableInvidious'],
|
|
|
|
(result) => {
|
|
|
|
disableNitter.checked = !result.disableNitter;
|
|
|
|
disableInvidious.checked = !result.disableInvidious;
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
disableNitter.addEventListener('change', (event) => {
|
|
|
|
chrome.storage.sync.set({ disableNitter: !event.target.checked });
|
|
|
|
});
|
|
|
|
|
|
|
|
disableInvidious.addEventListener('change', (event) => {
|
|
|
|
chrome.storage.sync.set({ disableInvidious: !event.target.checked });
|
|
|
|
});
|
|
|
|
|
|
|
|
document.querySelector('#options').addEventListener('click', () => {
|
2019-09-29 15:04:24 +02:00
|
|
|
if (chrome.runtime.openOptionsPage) {
|
|
|
|
chrome.runtime.openOptionsPage();
|
|
|
|
} else {
|
|
|
|
window.open(chrome.runtime.getURL('../options/options.html'));
|
|
|
|
}
|
|
|
|
});
|