Skip to content

Commit

Permalink
Added ad removal to homepage (adamlui/userscripts#106)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamlui committed Oct 28, 2024
1 parent f59652e commit b46849c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion greasemonkey/youtube-classic.user.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// ==UserScript==
// @name YouTube™ Classic 📺 — (Remove rounded design + Return YouTube dislikes)
// @version 2024.10.28.2
// @version 2024.10.28.3
// @author Adam Lui, Magma_Craft, Anarios, JRWR, Fuim & hoothin
// @namespace https://github.com/adamlui
// @description Reverts YouTube to its classic design (before all the rounded corners & hidden dislikes) + redirects YouTube Shorts
Expand Down Expand Up @@ -1989,4 +1989,11 @@
}, 1000);
}

// Remove ads from homepage
if (location.pathname == '/')
new MutationObserver(() => {
const adSlot = document.querySelector('ytd-ad-slot-renderer')
if (adSlot) adSlot.parentNode.parentNode.remove()
}).observe(document.documentElement, { childList: true, subtree: true })

})()

0 comments on commit b46849c

Please sign in to comment.