ExHentai - Preload next page

Loosely inspired by "Handy ExHentai" script. Now loads more pages by nesting iFrames.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

You will need to install an extension such as Tampermonkey to install this script.

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==UserScript==
// @name		ExHentai - Preload next page
// @version	1.1
// @namespace	exhentai-preload-page
// @author	BlindJoker
// @homepage	https://github.com/BlindJoker
// @description	Loosely inspired by "Handy ExHentai" script. Now loads more pages by nesting iFrames.
// @match		http://exhentai.org/s/*
// @match		http://g.e-hentai.org/s/*
// @run-at		document-end
// @grant		none
// ==/UserScript==
/*
* Let the user scripts or content scripts running in an annoymous function.
*/
(function (window) {
	"use strict";

	var pnext = document.getElementById("next").href;

	// Prevents possible infinite loadings
	if(window.self !== window.top && window.location.href == pnext) {
		console.log("finished loading everything");
		return;
	}

	var nframe = document.createElement("iframe");
	nframe.src = pnext;
	nframe.id = "nframe";
	nframe.style.width = "1px";
	nframe.style.height = "1px";
	nframe.style.border = "none";

	document.getElementById("img").addEventListener('load', function() {
		document.body.appendChild(nframe);
	});

	var script = document.createElement('script');

	script.type = "text/javascript";
	script.innerHTML =  	"var uweo = update_window_extents;" +
			"update_window_extents = function() {" +
			"	uweo();" +
			"	document.getElementById('img').addEventListener('load', function() {" +
			"		document.getElementById('nframe').src = document.getElementById('next').href;" +
			"	});" +
			"}";

	document.head.appendChild(script);
}) (window);