// ==UserScript== // @name ChatGPT Logo 换成 DeepSeek (sidebar-header, 自定义尺寸) // @namespace https://gist.doracoin.cc/doracoin/39fd3ec77d3044fc95b408bdf6c0ac13 // @version 2025.09.09 // @description 替换 ChatGPT 左上角 sidebar-header 的 SVG logo 为 DeepSeek logo,并调整 a 标签和 logo 尺寸。 // @author Doracoin // @match https://chatgpt.com/* // @icon https://deepseek.com/favicon.ico // @grant none // ==/UserScript== (function() { 'use strict'; const deepseekLogoUrl = 'https://commons.wikimedia.org/wiki/Special:Redirect/file/DeepSeek_logo.svg'; function replaceLogo() { const link = document.querySelector('#sidebar-header a'); if (link && !link.classList.contains("deepseek-logo-replaced")) { // 修改 a 标签 class if (link.classList.contains("h-9")) { link.classList.remove("h-9"); link.classList.add("h-10"); } if (link.classList.contains("w-9")) { link.classList.remove("w-9"); link.classList.add("w-68"); } // 清空原始内容(ChatGPT 内联 SVG) link.innerHTML = ''; // 插入 DeepSeek logo const img = document.createElement('img'); img.src = deepseekLogoUrl; img.alt = "DeepSeek"; img.style.width = "145px"; img.style.height = "31px"; img.style.objectFit = "contain"; link.appendChild(img); link.classList.add("deepseek-logo-replaced"); } } replaceLogo(); const observer = new MutationObserver(replaceLogo); observer.observe(document.body, { childList: true, subtree: true }); })();