Skip to content

Instantly share code, notes, and snippets.

@ilovejs
Created February 5, 2022 04:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ilovejs/4ee433f631431d4800a2d1ebc6a7eb8e to your computer and use it in GitHub Desktop.
Save ilovejs/4ee433f631431d4800a2d1ebc6a7eb8e to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Google AdSense Ads Remover
// @namespace https://openuserjs.org/users/ner0
// @description Removes Google ads from its search results
// @icon https://www.google.com/adsense/start/images/favicon.ico
// @author ner0
// @copyright 2020, ner0 (https://openuserjs.org/users/ner0)
// @license MIT
// @version 0.1
// @supportURL https://openuserjs.org/scripts/ner0/Google_AdSense_Ads_Remover/issues
//
// @grant none
// @include https://www.google.*/search*
// ==/UserScript==
// Find all ads-ad class elements and remove them from the page
// query:
// #tads
// .ads-ad
(function () {
// document.querySelectorAll("#tads").forEach(element => element.remove());
var tads = document.getElementById("tads");
tads.remove();
var rhscol = document.getElementById("rhscol");
rhscol.remove();
var pushdownyes = document.getElementById("pushdownyes");
pushdownyes.parentElement.remove();
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment