-
Notifications
You must be signed in to change notification settings - Fork 0
/
options.js
37 lines (31 loc) · 1.29 KB
/
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
28
29
30
31
32
33
34
35
36
37
// chrome.storage.sync.get("tabsRemoved", function(data) {
// count = data.tabsRemoved || 0;
// tabsRemovedCounter.innerHTML = "Tabs Removed: " + count;
// });
// let page = document.getElementById('buttonDiv');
// const kButtonColors = ['#3aa757', '#e8453c', '#f9bb2d', '#4688f1', 'white'];
// function constructOptions(kButtonColors) {
// for (let item of kButtonColors) {
// let button = document.createElement('button');
// button.style.backgroundColor = item;
// button.addEventListener('click', function() {
// chrome.storage.sync.set({color: item}, function() {
// console.log('color is ' + item);
// })
// });
// page.appendChild(button);
// }
// }
// constructOptions(kButtonColors);
/* Pause Button */
let exactMatchToggle = document.getElementById("exact-match-toggle");
chrome.storage.sync.get('disableExactMatch', function(data) {
exactMatchToggle.innerHTML = data.disableExactMatch ? "Off" : "On";
});
exactMatchToggle.onclick = function(element) {
chrome.storage.sync.get('disableExactMatch', function(data) {
chrome.storage.sync.set({disableExactMatch: !data.disableExactMatch}, function() {
exactMatchToggle.innerHTML = !data.disableExactMatch ? "Off" : "On";
});
});
};