Utoljára aktív 1778119947

在办公室使用gpt会被同事追问:你怎么用上的?怎么翻墙的?能给我用用吗?而你又不想给这类 “等人喂饭” 的人群分享时,那么这个脚本就可以帮助到你了

Revízió 632b0cb4719574f79bf58cb4ec10b0735bb06082

change-gpt-logo.user.js Eredeti
1// ==UserScript==
2// @name ChatGPT Logo 换成 DeepSeek (sidebar-header, 自定义尺寸)
3// @namespace https://gist.doracoin.cc/doracoin/39fd3ec77d3044fc95b408bdf6c0ac13
4// @version 2025.09.09
5// @description 替换 ChatGPT 左上角 sidebar-header 的 SVG logo 为 DeepSeek logo,并调整 a 标签和 logo 尺寸。
6// @author Doracoin
7// @match https://chatgpt.com/*
8// @icon https://deepseek.com/favicon.ico
9// @grant none
10// ==/UserScript==
11
12(function() {
13 'use strict';
14
15 const deepseekLogoUrl = 'https://commons.wikimedia.org/wiki/Special:Redirect/file/DeepSeek_logo.svg';
16
17 function replaceLogo() {
18 const link = document.querySelector('#sidebar-header a');
19 if (link && !link.classList.contains("deepseek-logo-replaced")) {
20 // 修改 a 标签 class
21 if (link.classList.contains("h-9")) {
22 link.classList.remove("h-9");
23 link.classList.add("h-10");
24 }
25 if (link.classList.contains("w-9")) {
26 link.classList.remove("w-9");
27 link.classList.add("w-68");
28 }
29
30 // 清空原始内容(ChatGPT 内联 SVG)
31 link.innerHTML = '';
32
33 // 插入 DeepSeek logo
34 const img = document.createElement('img');
35 img.src = deepseekLogoUrl;
36 img.alt = "DeepSeek";
37 img.style.width = "145px";
38 img.style.height = "31px";
39 img.style.objectFit = "contain";
40
41 link.appendChild(img);
42 link.classList.add("deepseek-logo-replaced");
43 }
44 }
45
46 replaceLogo();
47
48 const observer = new MutationObserver(replaceLogo);
49 observer.observe(document.body, { childList: true, subtree: true });
50})();
51