-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpopup.js
More file actions
52 lines (43 loc) · 1.23 KB
/
popup.js
File metadata and controls
52 lines (43 loc) · 1.23 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
hide.addEventListener("click", async () => {
let [tab] = await chrome.tabs.query({ active: true, currentWindow: true });
chrome.scripting.executeScript({
target: { tabId: tab.id },
function: hideInfo,
});
});
show.addEventListener("click", async () => {
let [tab] = await chrome.tabs.query({ active: true, currentWindow: true });
chrome.scripting.executeScript({
target: { tabId: tab.id },
function: showInfo,
});
});
function hideInfo() {
var info = document.getElementsByClassName("info");
var val = `z-index: 1;
position: absolute;
color: red;
margin-top: 60%;
letter-spacing: 0;
text-align: left;
font-size: 12px;
visibility: hidden;`
var len = info.length;
for(var i = 0; i < len; i++)
info[i].setAttribute("style", val);
}
function showInfo() {
var info = document.getElementsByClassName("info");
var valShow =
`z-index: 1;
position: absolute;
color: red;
margin-top: 60%;
letter-spacing: 0;
text-align: left;
font-size: 12px;
visibility: visible;`
var len = info.length;
for(var i = 0; i < len; i++)
info[i].setAttribute("style", valShow);
}