Skip to content

Instantly share code, notes, and snippets.

@ehoppmann
Created January 6, 2022 19:54
Show Gist options
  • Save ehoppmann/a4c00f61a51ea51f608080360631cb39 to your computer and use it in GitHub Desktop.
Save ehoppmann/a4c00f61a51ea51f608080360631cb39 to your computer and use it in GitHub Desktop.
Remove google text adds tampermonkey userscript
// ==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