-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontent.js
43 lines (36 loc) · 1.06 KB
/
content.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
38
39
40
41
42
43
chrome.runtime.onMessage.addListener(function (request, sender, sendResponse) {
window.parent.document.body.style.zoom = 0.2;
setTimeout(function () {
let scrollBar = document.getElementsByClassName(
"TnISae CnDs7d hPqowe crOkHf"
)[0];
if (scrollBar) {
scrollBar.scrollIntoView({ block: "start" });
}
}, 500);
setTimeout(function () {
var re = "cS7aqe NkoVdd";
var htmlImena = document.getElementsByClassName(re);
var imena = [];
for (i = 0; i < htmlImena.length; i++) {
htmlImena[i].scrollIntoView();
var hImena = document.getElementsByClassName(re);
for (j = 0; j < hImena.length; j++) {
if (hImena[j]) {
if (imena.includes(hImena[j].innerHTML)) {
console.log("postoji vec :" + hImena[j].innerHTML);
continue;
}
imena.push(hImena[j].innerHTML);
}
}
}
window.document.body.style.zoom = 1;
sendResponse({
url: window.location.href,
count: imena.length,
data: imena,
});
}, 1000);
return true;
});