-
Notifications
You must be signed in to change notification settings - Fork 12
/
options.js
27 lines (25 loc) · 905 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
27
function save_options() {
var autoTaint = document.getElementById('autoTaint').checked;
var muteNotifications = document.getElementById('muteNotifications').checked;
chrome.storage.local.set({
'autoTaint': autoTaint,
'muteNotifications': muteNotifications,
}, function() {
var status = document.getElementById('status');
status.textContent = 'Options saved.';
setTimeout(function() {
status.innerHTML = ' ';
}, 1000);
});
}
function restore_options() {
chrome.storage.local.get({
'autoTaint': false,
'muteNotifications': false,
}, function(items) {
document.getElementById('autoTaint').checked = items.autoTaint;
document.getElementById('muteNotifications').checked = items.muteNotifications;
});
}
document.addEventListener('DOMContentLoaded', restore_options);
document.getElementById('save').addEventListener('click', save_options);