Hide ChatGPT Header

隐藏 https://chatgpt.com/ 页面顶部的共享栏

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

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.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name         Hide ChatGPT Header
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description  隐藏 https://chatgpt.com/ 页面顶部的共享栏
// @match        https://chatgpt.com/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // 使用 MutationObserver 等待目标元素加载完成
    const observer = new MutationObserver(() => {
        const header = document.querySelector('.draggable.sticky.top-0.z-10.flex.min-h-[60px].items-center.justify-center.border-transparent.bg-token-main-surface-primary.pl-0.md\\:hidden');
        if (header) {
            header.style.display = 'none';
            observer.disconnect();  // 找到元素后停止观察
        }
    });

    // 开始观察整个页面的 DOM 变化
    observer.observe(document.body, { childList: true, subtree: true });
})();