Hide ChatGPT Header

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==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 });
})();