隐藏 AI Studio 界面元素 (头部/推广)

Hides the header and promo gallery on Google AI Studio using a robust CSS injection method.

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         隐藏 AI Studio 界面元素 (头部/推广)
// @namespace    http://tampermonkey.net/
// @version      1.2
// @description  Hides the header and promo gallery on Google AI Studio using a robust CSS injection method.
// @description:zh-CN  通过强大的CSS注入方法,隐藏 Google AI Studio 上的头部和推广画廊。
// @author       hdh
// @match        *://aistudio.google.com/*
// @grant        GM_addStyle
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    const selectorsToHide = [
        'ms-header-root',
        'ms-promo-gallery'
    ];

    const cssSelectorString = selectorsToHide.join(', ');

    const css = `
        ${cssSelectorString} {
            display: none !important;
        }
    `;

    GM_addStyle(css);

    console.log('Tampermonkey: CSS rule to hide header and promo elements has been injected.');
})();