-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbackground.js
40 lines (32 loc) · 1.47 KB
/
background.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
(async () => {
const res = await chrome.storage.local.get(["listOfClass_forDarkTheme"]);
window.location.toString();
for (let link in res.listOfClass_forDarkTheme) {
if (!link) return;
if (window.location.toString().split("/")[2] == link)
for (let className in res.listOfClass_forDarkTheme[link]) {
const element = document.querySelectorAll("." + className);
if (element[0]) {
for (item of element) {
let color = res.listOfClass_forDarkTheme[link][className];
item.style.backgroundColor = color;
item.style.color = "white";
}
}
}
}
if (window.location.toString().indexOf("www.anilibria.tv") != -1)
document.querySelector("html").setAttribute("data-theme", "dark");
if (window.location.toString().indexOf("test-english.com") != -1)
document.querySelector(".watupro-gap").style.color = "#000000";
if (window.location.toString().indexOf("ru.wikipedia.org") != -1) {
let tables = document.querySelector("table");
let figurs = document.querySelectorAll("figcaption");
let links = document.querySelectorAll("a");
if (tables[0])
tables.forEach((table) => (table.style.backgroundColor = "#606060"));
if (figurs[0])
figurs.forEach((figur) => (figur.style.backgroundColor = "#606060"));
if (links[0]) links.forEach((link) => (link.style.color = "#00e4ff"));
}
})();