您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Greasy Fork is available in English.
Modify Stage1 text property for AA
当前为
// ==UserScript== // @name AA for S1 // @namespace http://tampermonkey.net/ // @version 0.5 // @description Modify Stage1 text property for AA // @author 冰箱研会长 // @match https://bbs.saraba1st.com/2b/* // @grant GM_addStyle // ==/UserScript== var AA_author_array = new Array("冰箱研会长e-3M","冰箱研会长"); function getElementByXpath(path) { return document.evaluate(path, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue; } function Reset_BlockCode(NodeRoot){ var CodeBlocks = NodeRoot.getElementsByClassName("blockcode"); if(CodeBlocks){ for(var i = 0; i < CodeBlocks.length;i++){ var CodeBlock=CodeBlocks[i]; CodeBlock.style.fontSize="12px"; CodeBlock.style.lineHeight="22px"; CodeBlock.style.fontFamily="Monaco, Consolas, Lucida Console, Courier New, serif"; CodeBlock.style.whiteSpace = "normal"; } } } function Reset_BlockQuote(NodeRoot){ var QuoteBlocks = NodeRoot.getElementsByClassName("blockquote"); if(QuoteBlocks){ for(var i = 0; i < QuoteBlocks.length;i++){ var QuoteBlock=QuoteBlocks[i]; QuoteBlock.style.fontSize="12px"; QuoteBlock.style.lineHeight="22px"; QuoteBlock.style.fontFamily="Monaco, Consolas, Lucida Console, Courier New, serif"; QuoteBlock.style.whiteSpace = "pre-wrap"; } } } function AAPosts_Modifier(){ var PostLists = getElementByXpath(`//div[@id='postlist']`); if(PostLists){ var PostCounter = 1; while(getElementByXpath(`//div[@id='postlist']/div[${PostCounter}]`)){ var PostAuthor = getElementByXpath(`//div[@id='postlist']/div[${PostCounter}]/table/tbody/tr[1]/td[1]/div/div[1]/div/a`); if(PostAuthor){ if( AA_author_array.includes(PostAuthor.innerText) ){ var ReplyBox = getElementByXpath(`//div[@id='postlist']/div[${PostCounter}]/table/tbody/tr[1]/td[2]/div[2]/div/div[1]/table/tbody/tr/td`); ReplyBox.style.fontSize = "16px"; ReplyBox.style.lineHeight = "18px"; ReplyBox.style.fontFamily = "MS PGothic"; ReplyBox.style.whiteSpace = "normal"; Reset_BlockCode(ReplyBox); Reset_BlockQuote(ReplyBox); } } PostCounter = PostCounter + 1; } } } AAPosts_Modifier();