您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Strip empty paragraphs on Archive of Our Own fics
// ==UserScript== // @name AO3: Strip Work's Empty Paragraphs // @description Strip empty paragraphs on Archive of Our Own fics // @author the_wanlorn // @version 1.0 // @license MIT // @grant none // @include https://archiveofourown.org/works/* // @include https://archiveofourown.org/*/works/* // @include http://archiveofourown.org/works/* // @include http://archiveofourown.org/*/works/* // @namespace https://greasyfork.org/users/844343 // ==/UserScript== var work = document.getElementById('workskin'); var paragraphs = work.getElementsByTagName("p"); for (var i = 0; i < paragraphs.length; i++) { var no_text = paragraphs[i].textContent.replace(/\s| /gm,'').length == 0, no_content = paragraphs[i].querySelectorAll("[src]").length == 0; if (no_text && no_content) { paragraphs[i].remove(); } }