-
Notifications
You must be signed in to change notification settings - Fork 0
/
popup.js
34 lines (32 loc) · 1010 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
29
30
31
32
33
34
document.addEventListener(
"DOMContentLoaded",
function () {
var checkButton = document.getElementById("switch");
checkButton.addEventListener(
"click",
function (e) {
checkButton.checked
? chrome.tabs.query(
{ active: true, currentWindow: true },
function (activeTabs) {
// WAY 1
chrome.tabs.executeScript(activeTabs[0].id, {
code: ` document.getElementById('Dark_layer_hitesh').style.display = ''; `,
});
}
)
: chrome.tabs.query(
{ active: true, currentWindow: true },
function (activeTabs) {
// WAY 1
chrome.tabs.executeScript(activeTabs[0].id, {
code: ` document.getElementById('Dark_layer_hitesh').style.display = 'none';`,
});
}
);
},
false
);
},
false
);