oglaf NextPage clarifier

Oglaf has stories which may have 1 or more pages. The "Next Page" button takes you to the next story if there isn't a next page, which is a bit unclear.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name        oglaf NextPage clarifier
// @namespace   https://greasyfork.org/users/2226-adam
// @description Oglaf has stories which may have 1 or more pages. The "Next Page" button takes you to the next story if there isn't a next page, which is a bit unclear.
// @include     htt*://oglaf.com/*
// @version     1.0
// @grant       none
// @require     http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js
// ==/UserScript==
function main()
{
	var navlinks = $('[id=nav]');
	var nextPageLink = navlinks.children()[2];
	var nextStoryLink = navlinks.children()[4];
	if(nextPageLink.href == nextStoryLink.href)
	{
		var NoNextPageElm = document.createElement('div');
		NoNextPageElm.id="nnx";
		NoNextPageElm.className="nav_ro";
		nextPageLink.parentNode.replaceChild(NoNextPageElm, nextPageLink);
	}
}
$(document).ready(main);