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 για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

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

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

Advertisement:

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

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
    });
})();