Remove specific element from page
// ==UserScript==
// @name Remove MyAdCenter Popup (Youtube AdBlock)
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Remove specific element from page
// @author zvddfdzfd fsdfs
// @match https://www.youtube.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=youtube.com
// @grant none
// @license MIT
// ==/UserScript==
(function() {
var targetClass = 'ytd-popup-container';
function removeElement() {
var elem = document.getElementsByClassName(targetClass);
if (elem.length > 0) {
elem[0].remove();
console.log("Remove My Ad Center Popup : Removed ✅ ")
}
}
setInterval(function() {
removeElement();
}, 1000); // check every 3 seconds
removeElement();
var observer = new MutationObserver(function() {
removeElement();
});
observer.observe(document.body, {
childList: true,
subtree: true
});
})();