您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Makes surrounding text lighter while making text within quotations stand out. Supports Safari and works with FixSpacing.
当前为
// ==UserScript== // @name Emphasize Quotes // @namespace ChatFormatting // @match https://beta.character.ai/chat* // @grant none // @license MIT // @version 1.1 // @author Anon // @description Makes surrounding text lighter while making text within quotations stand out. Supports Safari and works with FixSpacing. // @run-at document-end // ==/UserScript== // Color of text wrapped in quotations // Default: "#FFFFFF"; const quoteColor = "#FFFFFF"; // Color of surrounding text // Default: "#B2B2B2"; const textColor = "#B2B2B2"; // How big do you want quoted text to be? (Non-Safari ONLY!) // Default: "1.05em"; const fontSize = "1.05em"; (function () { // Apply the base CSS for gray text and better spacing let css = ` .markdown-wrapper p { color: ${textColor}; } `; var head = document.getElementsByTagName("head")[0]; var style = document.createElement("style"); style.setAttribute("type", 'text/css'); style.innerHTML = css; head.appendChild(style); // Emphasize quotes by making them the specified color let timeoutId; const isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent); function changeColors() { clearTimeout(timeoutId); const pTags = document.getElementsByTagName('p'); let changed = false; for (let i = 0; i < pTags.length; i++) { const pTag = pTags[i]; if (pTag.dataset.colorChanged === 'true') { continue; } let text = pTag.innerHTML; if (text.match(/(["“”«»].*?["“”«»])/)) { text = text.replace(/(["“”«»].*?["“”«»])/g, '<span style="color: ' + quoteColor + (isSafari ? '' : '; font-size: ' + fontSize) + '">$1</span>'); pTag.innerHTML = text; pTag.dataset.colorChanged = 'true'; changed = true; } } } function checkForChanges(mutations) { if (mutations.length > 0) { changeColors(); } } const observer = new MutationObserver(checkForChanges); observer.observe(document.body, { attributes: true, childList: true, subtree: true }); })();