-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathblockyt.js
26 lines (21 loc) · 973 Bytes
/
blockyt.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
const observer = new MutationObserver(() => {
const imageAds = document.getElementsByClassName('badge-style-type-ad');
if (imageAds) {
for (const ad of imageAds) {
ad.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.remove()
}
}
const moreImageAds = document.getElementsByClassName('YtwFeedAdMetadataViewModelHostMetadata')
if (moreImageAds) {
for (const ad of imageAds) {
ad.parentElement.parentElement.parentElement.parentElement.parentElement.remove()
}
}
const evenMoreImageAds = document.getElementsByClassName('ytd-ad-inline-playback-meta-block')
if (evenMoreImageAds) {
for (const ad of evenMoreImageAds) {
ad.parentElement.parentElement.parentElement.parentElement.parentElement.remove()
}
}
})
observer.observe(document.body, { childList: true, subtree: true });