Created
November 4, 2025 14:36
-
-
Save bschulz87/37d43043c0f9eeaf60d90669b1a6e5cb to your computer and use it in GitHub Desktop.
Hide Google AI Bullshit
This file contains hidden or 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 Hide Bullshit | |
| // @namespace http://tampermonkey.net/ | |
| // @version 2025-11-04 | |
| // @description | |
| // @author You | |
| // @match https://www.google.com/* | |
| // @icon https://www.google.com/s2/favicons?sz=64&domain=google.com | |
| // @grant none | |
| // ==/UserScript== | |
| const needle = { | |
| overview: "Übersicht mit KI", | |
| search: "KI‑Modus", | |
| results: "Suchergebnisse", | |
| }; | |
| function runWhenReady(readySelector, callback) { | |
| // Source: https://github.com/Tampermonkey/tampermonkey/issues/1279#issuecomment-2892507825 | |
| const TIMEOUT_SEC = 3; | |
| performance.mark("startReadyCheck"); | |
| var tryMeasure; | |
| var numAttempts = 0; | |
| var tryNow = function () { | |
| var elem = document.querySelector(readySelector); | |
| if (elem) { | |
| callback(elem); | |
| } else { | |
| numAttempts++; | |
| tryMeasure = performance.measure("startReadyCheck"); | |
| if (tryMeasure.duration > TIMEOUT_SEC * 1000) { | |
| console.log( | |
| "Giving up after", | |
| tryMeasure.duration / 1000, | |
| "seconds; could not find", | |
| readySelector, | |
| ); | |
| } else { | |
| setTimeout(tryNow, 250 * Math.pow(1.1, numAttempts)); | |
| } | |
| } | |
| }; | |
| tryNow(); | |
| } | |
| (function () { | |
| "use strict"; | |
| runWhenReady("[data-container-id", () => { | |
| console.log("=== Removing bullshit ==="); | |
| if ( | |
| [...document.querySelectorAll("div")].find( | |
| (e) => e.textContent === needle.overview, | |
| ) | |
| ) { | |
| [...document.querySelectorAll("h1")] | |
| .find((e) => e.textContent === needle.results) | |
| ?.parentElement.toggleAttribute("hidden"); | |
| } | |
| console.log("=== Done removing bullshit ==="); | |
| }); | |
| [...document.querySelectorAll("span")] | |
| .find((e) => e.textContent === needle.search) | |
| ?.closest("button") | |
| ?.toggleAttribute("hidden"); | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment