ChatGPT – Remove Nag Banners

Removes the no-auth rate limit modal and all login/signup nag banners on ChatGPT when not signed in.

目前為 2025-11-17 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         ChatGPT – Remove Nag Banners
// @description  Removes the no-auth rate limit modal and all login/signup nag banners on ChatGPT when not signed in.
// @namespace    https://greasyfork.org/users/kosherkale
// @author       kosherkale
// @version      1.1
// @match        https://chatgpt.com/*
// @match        https://chat.openai.com/*
// @run-at       document-idle
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    function cleanUI() {
        const modal = document.querySelector('div[data-testid="modal-no-auth-rate-limit"]');
        if (modal) modal.remove();

        document.querySelectorAll('aside').forEach(aside => {
            const txt = aside.textContent || '';
            if (
                txt.includes('Get smarter responses') ||
                txt.includes("You're now using our basic model") ||
                (txt.includes('create an account') && txt.includes('Log in'))
            ) {
                aside.remove();
            }
        });

        document.querySelectorAll('.fixed.inset-0, [data-overlay="true"]').forEach(el => {
            const style = getComputedStyle(el);
            if (style.position === 'fixed' && style.inset === '0px') {
                el.remove();
            }
        });

        ['no-scroll', 'overflow-hidden'].forEach(cls => {
            document.documentElement.classList.remove(cls);
            document.body.classList.remove(cls);
        });
        document.documentElement.style.overflow = '';
        document.body.style.overflow = '';
        document.documentElement.style.pointerEvents = 'auto';
        document.body.style.pointerEvents = 'auto';
    }

    cleanUI();

    const observer = new MutationObserver(cleanUI);
    observer.observe(document.documentElement, { childList: true, subtree: true });

    window.addEventListener('wheel', e => {
        const chatContainer = document.querySelector('main div[class*="overflow-y-auto"]');
        if (!chatContainer) return;

        chatContainer.scrollTop += e.deltaY;

        e.preventDefault();
    }, { passive: false });

})();