Google Ai Eradicator

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

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

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

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 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;
    }
});