// ==UserScript== // @name Beautify Story List fanfiction.net // @namespace http://tampermonkey.net/ // @version 1.0 // @description Changes colors and formats it to make stats to make it easier to read while scrolling, with Fandom blacklist included in the script. // @author バカなやつ // @license MIT // @match https://www.fanfiction.net/* // @icon https://www.google.com/s2/favicons?sz=64&domain=fanfiction.net // @grant GM_addStyle // @downloadURL none // ==/UserScript== GM_addStyle(".greenHighlight {color:#C4FFCA;}"); GM_addStyle(".redHighlight {color:#CC5500;}"); GM_addStyle(".yellowHighlight {color:#FFC300;}"); GM_addStyle(".pinkHighlight {color:#FFC0CB;}"); GM_addStyle(".z-indent {padding-left: 60px;}"); (function() { 'use strict'; // Remove fandoms from view page // const blacklist_fandoms = ["Harry", "Doctor Who", "Crossover - Star Wars", "Yu-Gi-Oh"] const blacklist_fandoms = []; function customList(story, stat){ let n_sub = stat.innerHTML if (!document.URL.startsWith("https://www.fanfiction.net/s/")) { // Moves reviews link to stat let review = story.getElementsByClassName("reviews")[0] // This removes and places it to " - Fa:" var text = review.outerHTML.replace(/>reviewsReviews: <").replace(/\<\/a\>/, ""); // Removes // Removes the original Reviews Link review.parentNode.removeChild(review); // Places the variable text to subContent[i] and replaces "Reviews:" n_sub = n_sub.replace(/Reviews:/, text); } // Places the start span at Chapters; ends span at Words n_sub = n_sub.replace(/Chapters:/, "Ch:") .replace(/\s\-\sWords:/, " - W:") // Ends span before - from "Reviews: ..." and Starts span before "Favs:" .replace(/\s\-\sFavs:/, " - Favs:") // Ends before "Published:" .replace(/\s\-\sPublished:/, " - Published:"); /* Moves the "Publish: ... Characters:" before "
Chapters:" */ let t = n_sub.slice(n_sub.search(/Published:/)) // Remove previous "Publish: ... Characters:" n_sub = n_sub.slice(0, n_sub.search(/\s\-\sPublished:/)); // puts
before W: n_sub = n_sub.replace(/\ -1; i--){ let storyContent = stories[i].getElementsByClassName("z-padtop2") let text = storyContent[0].innerHTML if (blacklist_fandoms.some(v => text.includes(v))) { stories[i].parentNode.removeChild(stories[i]); } } let status = document.getElementsByClassName("z-padtop2") for (let i = 0; i < stories.length; i++){ customList(stories[i], status[i]); } // For viewing inside stories if (document.URL.startsWith("https://www.fanfiction.net/s")) { status = document.getElementsByClassName("xgray")[0]; customList(stories[0], status); } }); })();