Google AI Mode button remover

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

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

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

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

Advertisement:

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

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