-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontent.js
More file actions
45 lines (38 loc) · 1.32 KB
/
content.js
File metadata and controls
45 lines (38 loc) · 1.32 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
const style = document.createElement("style");
style.textContent = `
#logo h1 a {
background: url("https://raw.githubusercontent.com/OnlyMaxi/shtiss/refs/heads/main/media/SHIT.png") no-repeat top left !important;
background-size: auto 100% !important;
}
@media only screen and (max-width: 949px) and (-webkit-min-device-pixel-ratio: 1.3), only screen and (max-width: 949px) and (min-resolution: 124.8dpi) {
#logo h1 a {
background: none !important;
}
#header {
background: url("https://raw.githubusercontent.com/OnlyMaxi/shtiss/refs/heads/main/media/SHITbanner.png") no-repeat top left #024363 !important;
background-size: auto 100% !important;
}
}
`;
function appendNewStyle() {
document.head.appendChild(style);
}
function main() {
if (document.head) {
appendNewStyle();
} else {
const observer = new MutationObserver(() => {
if (document.head) {
appendNewStyle();
observer.disconnect();
}
});
observer.observe(document.documentElement, { childList: true, subtree: true });
}
}
chrome.storage.sync.get(["shtissStatus"], (data) => {
const status = data.shtissStatus ?? false;
if (status) {
main();
}
});