Try to block ads
// ==UserScript==
// @name nozcy ads block
// @namespace http://tampermonkey.net/
// @version 0.2
// @description Try to block ads
// @author @nozcy
// @match *://*/*
// @grant none
// @license MTT
// ==/UserScript==
(function() {
'use strict';
function blockAds() {
const elementsToRemove = document.querySelectorAll('iframe[src*="ad"], div[id*="ad"], div[class*="ad"], div[data-ad-slot]');
for (const element of elementsToRemove) {
element.remove();
}
}
// Block ads on page load
blockAds();
// Also block ads every 100 milliseconds
setInterval(blockAds, 100);
})();