您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Expand Text Field in PostPrime timeline
当前为
// ==UserScript== // @name PostPrime - Expand Text Field // @namespace https://github.com/y-muen // @version 0.1 // @description Expand Text Field in PostPrime timeline // @author y-marui // @include *://postprime.com/* // @exclude *://postprime.com/*/post/* // @icon https://www.google.com/s2/favicons?domain=postprime.com // @grant GM_addStyle // ==/UserScript== (function() { 'use strict'; GM_addStyle(".Post_postWrapper__3paC7 .Post_post__uK6-5 .Post_postTextWrapper__nyr9Y .Post_postText__VX_Gf {-webkit-line-clamp:10;}"); var main = () =>{ if(document.URL == "https://postprime.com/" || document.URL == "https://postprime.com") { var richcontent = document.getElementsByClassName('richcontent') richcontent = Array.from(richcontent); console.log(richcontent); richcontent.forEach( (elem) => { var innerHTML = elem.innerHTML.replaceAll(/\n\n+/g, "\n\n"); if(innerHTML != elem.innerHTML) { elem.innerHTML = innerHTML; } }); } } main(); const observer = new MutationObserver((mutations) => { mutations.forEach((mutation) => { main() }); }); const config = { attributes: false, childList: true, characterData: false, subtree:true }; observer.observe(document, config); })();