Disable Google Ai OverView

Google AI概要を削除(ちらつき防止)

当前为 2025-10-03 提交的版本,查看 最新版本

// ==UserScript==
// @name         Disable Google Ai OverView
// @namespace    http://tampermonkey.net/
// @version      2025-10-04
// @description  Google AI概要を削除(ちらつき防止)
// @author       Ruku
// @match        http://*/*
// @match        https://*/*
// @grant        none
// @run-at       document-start
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

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

    // DOMが出来た後に削除
    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 });
})();