Google Ai Eradicator

Removes the google ai overview from a search query and removes the "Try gemini" button from gmail

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name        Google Ai Eradicator
// @name:de     Google Ki Entferner
// @namespace   HanneKaffeeKanne
// @license     GPL 3.0
// @match       https://www.google.com/search*
// @match       https://mail.google.com/mail*
// @version     1.4
// @author      Hannes Leonhartsberger
// @description Removes the google ai overview from a search query and removes the "Try gemini" button from gmail
// @description:de Entfernt die Ki Zusammenfassung einer Suchanfrage auf google und entfernt den "Gemini ausprobieren" Knopf von GMail.
// @require https://cdn.jsdelivr.net/npm/@violentmonkey/dom@2
// ==/UserScript==

//! Remove ai overview from google search
if(document.location.href.includes("google.com/search")) {
    if(!document.location.href.includes("&udm=")) {
        // Change from tab All to tab Web
        document.location.href = document.location.href + "&udm=14";
    } else {
        // Switch the All and Web tab
        let tabs = document.querySelector("div.crJ18e > div[role=list]");

        for(let [i, node] of Array.from(tabs.children).entries()) {
            if(i === 0) {
                node.remove();
            }

            if(node.innerHTML.includes("Web")) {
                tabs.prepend(node);
            }
        }
    }
}

//! Remove Mail Ai
const disconnect = VM.observe(document.body, () => {
    const node = document.querySelector("div:has(> div.r4vW1e.e5IPTd)");

    if(node) {
        node.remove();

        return true;
    }
});