E-H Fjords

Redirects galleries automatically.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

Bạn sẽ cần cài đặt một tiện ích mở rộng như Tampermonkey hoặc Violentmonkey để cài đặt kịch bản này.

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

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

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

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

(Tôi đã có Trình quản lý tập lệnh người dùng, hãy cài đặt nó!)

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.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name           E-H Fjords
// @description    Redirects galleries automatically.
// @author         Hen Tie
// @homepage       https://hen-tie.tumblr.com/
// @namespace      https://greasyfork.org/en/users/8336
// @include        /https://e-hentai.org\/[sg]\/.*/
// @icon           https://i.imgur.com/pMMVGRx.png
// @version        1.0
// ==/UserScript==
// based on Mexiguy's Fjords Begone (sleazyfork.org/en/scripts/2053)

//redirect behaviour
var delayRedirect = false; //true=delayed with message, false=instant
var delayTime = 2000; //in milliseconds

function redirectPage() {
	var redirectUrl = document.location.toString().replace("e-hentai", "exhentai");
	document.location = redirectUrl;
}

if (document.title.indexOf("Gallery Not Available") >= 0) {
	//break homepage redirect timeout
	document.getElementById('continue').remove();
	//custom redirect message
	document.getElementsByTagName('p')[1].remove();
	document.getElementsByClassName('d')[0].innerHTML += "<P><em>E-H Fjords is redirecting you now…</em></p>";
	if (delayRedirect) {
		//custom title
		document.title = "E-H Fjords: Redirecting";
		//delay then redirect page
		setTimeout(redirectPage, delayTime);
	} else {
		redirectPage();
	}
}