Disable Google Ai OverView

Google検索で表示されるAI概要を抑制・削除します。

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

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

(I already have a user script manager, let me install it!)

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.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         Disable Google Ai OverView
// @namespace    http://tampermonkey.net/
// @version      2025-10-04-2
// @description  Google検索で表示されるAI概要を抑制・削除します。
//               方法: 
//                 1. data-subtree="mfc,mfl" のDOMを非表示&削除
//                 2. URLを https://www.google.com/search?udm=14&q=キーワード に書き換え
//                    (動作保証はなく環境依存)
// @author       Ruku
// @match        https://www.google.com/search*
// @match        http://www.google.com/search*
// @grant        none
// @run-at       document-start
// @icon         data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    // --- ① URL書き換え (udm=14 がなければ追加してリロード) ---
    (function enforceUDM14() {
        const url = new URL(window.location.href);
        if (url.hostname === "www.google.com" && url.pathname === "/search") {
            if (!url.searchParams.has("udm")) {
                url.searchParams.set("udm", "14");
                window.location.replace(url.toString());
            }
        }
    })();

    // --- ② CSSで初期から非表示にする ---
    const style = document.createElement('style');
    style.textContent = '[data-subtree="mfc,mfl"] { display: none !important; }';
    document.documentElement.appendChild(style);

    // --- ③ MutationObserverで追加ノードを監視し削除 ---
    new MutationObserver(mutations => {
        for (const m of mutations) {
            for (const node of m.addedNodes) {
                if (node.nodeType === 1) {
                    if (node.matches?.('[data-subtree="mfc,mfl"]')) {
                        node.remove();
                    }
                    node.querySelectorAll?.('[data-subtree="mfc,mfl"]').forEach(el => el.remove());
                }
            }
        }
    }).observe(document, { childList: true, subtree: true });

})();