-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathpopup.js
28 lines (22 loc) · 862 Bytes
/
popup.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
"use strict";
// const changeColor = document.getElementById("changeColor");
// // Set up our button's background color and value
// chrome.storage.sync.get("color", function (data) {
// changeColor.style.backgroundColor = data.color;
// changeColor.setAttribute("value", data.color);
// });
// changeColor.onclick = function (element) {
// let color = element.target.value;
// chrome.tabs.query({ active: true, currentWindow: true }, function (tabs) {
// chrome.tabs.executeScript(tabs[0].id, {
// code: 'document.body.style.backgroundColor = "' + color + '";',
// });
// });
// };
const checkboxHide = document.getElementById("checkboxHide");
chrome.storage.sync.get(["doHide"], (result) => {
checkboxHide.checked = result.doHide;
});
checkboxHide.onchange = (e) => {
chrome.storage.sync.set({ doHide: e.target.checked });
};