-
Notifications
You must be signed in to change notification settings - Fork 0
/
options.js
26 lines (26 loc) · 988 Bytes
/
options.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
function saveOptions(e)
{
e.preventDefault();
browser.storage.local.set(
{
removeURLsQueriesAndFragments: document.querySelector("#removeURLsQueriesAndFragments").checked,
hideLiveVideosFromYouTubeSubscriptionsList: document.querySelector("#hideLiveVideosFromYouTubeSubscriptionsList").checked
});
}
function restoreOptions()
{
function onError(error)
{
console.log(`Error: ${error}`);
}
browser.storage.local.get("removeURLsQueriesAndFragments").then(function(result)
{
document.querySelector("#removeURLsQueriesAndFragments").checked = result.removeURLsQueriesAndFragments;
}, onError);
browser.storage.local.get("hideLiveVideosFromYouTubeSubscriptionsList").then(function(result)
{
document.querySelector("#hideLiveVideosFromYouTubeSubscriptionsList").checked = result.hideLiveVideosFromYouTubeSubscriptionsList;
}, onError);
}
document.addEventListener("DOMContentLoaded", restoreOptions);
document.querySelector("form").addEventListener("submit", saveOptions);