XKCDCleaner

Wipe out trash and only leave the content.

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         XKCDCleaner
// @namespace    http://www.fuckboygamers.club
// @version      1.0
// @description  Wipe out trash and only leave the content.
// @author       Mr Whiskey
// @match        htt*://xkcd.com/*
// @require      http://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js
// ==/UserScript==

$( "div" ).remove( "#bottom" ); // Remove footer
$( "div" ).remove( "#topContainer" ); // Remove header
$("a").filter(":contains('|<')").remove(); // remove "comic one"
$("a").filter(":contains('>|')").remove(); // remove "recent comic"
$("a").filter(":contains('Random')").remove(); // remove "random"
$("a").filter(":contains('< Prev')").attr('href', 'javascript:history.back()'); // Change Prev button to go back to the last page you were on
$("a").filter(":contains('Next >')").attr('href', '//c.xkcd.com/random/comic/'); // Change Next button to find a random comic
$('div').last().remove(); // Remove "transcript" (invisible element containing no useful text)
$('div br:last-child')[0].nextSibling.nodeValue = ''; // Remove "Image Hyperlink" comment (Right click + copy image url)