// ==UserScript== // @name Outline背景颜色修改 // @namespace http://tampermonkey.net/ // @version 2025-11-15 // @description // @author ClanEver // @match https://outline.eimsound.com/* // @icon https://minio.eimsound.com/outline/public/d4335404-a074-4741-a98c-05f7b4f013bd/4b90f268-826c-420f-80a9-34cad76922c5/Icon-1024.png // @updateURL https://gitea.tryanks.com/ClanEver/public-snippets/raw/branch/main/Outline背景颜色修改.user.js // @downloadURL https://gitea.tryanks.com/ClanEver/public-snippets/raw/branch/main/Outline背景颜色修改.user.js // @grant GM_registerMenuCommand // @grant GM_getValue // @grant GM_setValue // @run-at document-start // ==/UserScript== (function () { 'use strict'; const need_change_css_selector = [ '.heading-actions', // h1, h2, ...前的# 'body', '.keGgMX', // header // 搜索页 header '.fyMCgw', // 内容页 body '.kiKzFH', '.jDTqnc', '.kiKzFH', '.bmnuZb', '.iDJNwL', // 内容页 标题 '.fwyrwy', '.dHFwSU', // 内容页 大纲 '.cLXGaH', '.eHuJFj', '.jxgRW', // 主页 body '.jHHYkE', // 主页 tab // 主页 list '.kbOwGd', '.hzJhrS', '.cMMsT', '.PGFjo', // 子页面 body '.epqDpQ', // 子页面 大纲 '.kHbYXa', // 子页面 list '.eZQAiy', '.gUQTOB', '.euvUWk', ] const need_change_css_str = need_change_css_selector.join(',') const DEFAULT_COLOR = '#f7f8fa'; function getColor() { return GM_getValue('bgColor', DEFAULT_COLOR); } function setColor(color) { GM_setValue('bgColor', color); } // 注册菜单命令 GM_registerMenuCommand('设置背景颜色', () => { const current = getColor(); const newColor = prompt('请输入新的背景颜色(如 #ffffff 或 red):', current); if (newColor) { setColor(newColor); } }); const style = document.createElement('style'); style.innerHTML = ` ${need_change_css_str} { background-color: ${getColor()} !important; } `; document.documentElement.appendChild(style); setInterval(function() { document.body.style.setProperty("background", "#f7f8fa", "important"); }, 500); })();