Google AI Mode button remover

Removes or hides the "AI Mode" button from Google Search results

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

Advertisement:

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

Advertisement:

// ==UserScript==
// @name         Google AI Mode button remover
// @name:tr      Google AI Modu butonu silici
// @namespace    https://google.com/
// @license MIT
// @version      1.0
// @description  Removes or hides the "AI Mode" button from Google Search results
// @description:tr Google arama sonuçları sayfasında görünen “AI Modu” butonunu otomatik olarak kaldırmak veya gizlemektir.
// @match        https://www.google.com/search*
// @match        https://www.google.com.tr/search*
// @grant        none
// @run-at       document-start
// ==/UserScript==

(function () {
    'use strict';

    function removeAIModeButton() {
        const links = document.querySelectorAll('a');

        links.forEach(link => {
            const text = link.innerText?.trim();

            const href = link.getAttribute('href') || '';

            const isAIMode =
                text === 'AI Modu' ||
                text === 'AI Mode' ||
                href.includes('udm=50') ||
                href.includes('aep=1');

            if (isAIMode) {
                const container =
                    link.closest('[role="listitem"]') ||
                    link.closest('.olrp5b') ||
                    link.parentElement;

                if (container) {
                    container.remove();
                } else {
                    link.remove();
                }
            }
        });
    }

    document.addEventListener('DOMContentLoaded', removeAIModeButton);

    const observer = new MutationObserver(() => {
        removeAIModeButton();
    });

    observer.observe(document.documentElement, {
        childList: true,
        subtree: true
    });
})();