// ==UserScript== // @name Fanfiction+ // @namespace DanielVestol.Fanfiction.net // @description Improves readability and allows EBOOK DOWNLOADS! // @include https://www.fanfiction.net/* // @include https://www.fictionpress.com/s/* // @version 1.18.2 // @grant GM_xmlhttpRequest // @downloadURL none // ==/UserScript== // SETTINGS const config = { ebookServer: "http://ebook.danielv.no:5001", //ebookServer: "http://localhost", }; // END OF SETTINGS console.log("DOM fully loaded and parsed"); // Better change between mobile and desktop edition. // Credits to SirCxyrtyx for snippet var mobileVersion = 'location = "https://m.fanfiction.net' + document.location.pathname + '"'; // console.log(mobileVersion); document.getElementsByClassName('icon-kub-mobile')[0].setAttribute('onclick', mobileVersion); // run code depending on what subpage we are on // for main page if(document.location.pathname == "/") { // Changing some simple styles document.getElementById('content_wrapper').style.maxWidth = '800px'; // appending a style tag in HTML $('#top').append(''); } if(document.location.pathname.substr(0, 3) == "/s/") { // Changing some simple styles $('#top').append(''); document.getElementById('content_wrapper').style.maxWidth = '800px'; // OCD friendly review field var review = document.getElementById('review'); review.getElementsByTagName('TD')[0].remove(); review.getElementsByTagName('TD')[0].remove(); // Remove element 1 which is now 0 review.getElementsByTagName('DIV')[0].style.maxWidth = '765px'; review.getElementsByTagName('DIV')[0].style.margin = '10px'; document.getElementById('review_name_value').style.maxWidth = '780px'; document.getElementById('review_review').style.maxWidth = '780px'; // // Show whole book function // $('#content_wrapper_inner > span:nth-child(7)').append(''); document.getElementById('myShit').addEventListener('click', function() { document.getElementById('storytextp').innerHTML = "