Skip to content

Commit d342da2

Browse files
committed
Removing ads and stretching out main
1 parent 36ddc6d commit d342da2

1 file changed

Lines changed: 48 additions & 5 deletions

File tree

injection.js

Lines changed: 48 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,51 @@
1-
// Comments
21
try {
3-
const comments = document.getElementById("wpd-threads")
4-
if (comments) comments.remove()
2+
const removeComments = () => {
3+
const comments = document.getElementById("wpd-threads")
4+
if (comments) comments.remove()
5+
}
6+
7+
const removeAds = () => {
8+
// Aside
9+
const asides = document.getElementsByTagName("aside")
10+
Array.from(asides).forEach((aside) => {
11+
if (aside) aside.remove()
12+
})
13+
14+
// Code Blocks(Ads ffmpeg)
15+
const codeBlocks = document.getElementsByClassName("code-block")
16+
Array.from(codeBlocks).forEach((codeBlock) => {
17+
if (codeBlock) codeBlock.remove()
18+
})
19+
}
20+
21+
const removeUniversalInsert = () => {
22+
const universalInserts = document.getElementsByClassName("humix-universal-js-insert")
23+
Array.from(universalInserts).forEach((universalInsert) => {
24+
if (universalInsert) universalInsert.remove()
25+
})
26+
}
27+
28+
const stretch = () => {
29+
const main = document.getElementsByClassName("main")[0]
30+
main.style.maxWidth = "100vw"
31+
main.style.width = "95vw"
32+
}
33+
34+
35+
// Comments
36+
removeComments()
37+
38+
// Ads
39+
removeAds()
40+
41+
// Additional videos (universal insert)
42+
removeUniversalInsert()
43+
44+
// Stretch out the Main
45+
stretch()
46+
547
} catch (error) {
6-
alert("Error") // Just for development part
48+
// alert("Error") // Just for development part
749
console.log("Error in ext")
8-
}
50+
}
51+

0 commit comments

Comments
 (0)