Created
January 6, 2022 19:54
-
-
Save ehoppmann/a4c00f61a51ea51f608080360631cb39 to your computer and use it in GitHub Desktop.
Remove google text adds tampermonkey userscript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Google AdSense Ads Remover | |
// @namespace https://gist.github.com/ehoppmann | |
// @description Removes Google ads from its search results | |
// @icon https://www.google.com/adsense/start/images/favicon.ico | |
// @author ehoppmann | |
// @copyright 2021, ehoppmann (https://gist.github.com/ehoppmann) | |
// @license MIT | |
// @version 0.1 | |
// @supportURL | |
// | |
// @grant none | |
// @include https://www.google.*/search* | |
// ==/UserScript== | |
function ready(fn) { | |
if (document.readyState !== 'loading'){ | |
fn(); | |
} else { | |
document.addEventListener('DOMContentLoaded', fn); | |
} | |
} | |
ready(function () { | |
document.querySelectorAll('[data-text-ad="1"]').forEach(element => element.remove()); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment