Fanfiction+

Makes subtle improvements to improve readability on fanfiction.net

当前为 2016-03-11 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name        Fanfiction+
// @namespace   DanielVestol.Fanfiction.net
// @description Makes subtle improvements to improve readability on fanfiction.net
// @include     https://www.fanfiction.net/s/*
// @version     1.2
// @grant       none
// ==/UserScript==
document.addEventListener("DOMContentLoaded", function(event) {
  console.log("DOM fully loaded and parsed");
  document.getElementById('content_wrapper').style.maxWidth = '800px';
  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';
  
  // 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) 
});