E-Hentai PervertMonkey

Infinite scroll [optional], Filter by Title

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

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

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

作者のサイトでサポートを受ける。または、このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name         E-Hentai PervertMonkey
// @namespace    pervertmonkey
// @version      1.0.20
// @author       violent-orangutan
// @description  Infinite scroll [optional], Filter by Title
// @license      MIT
// @icon         https://www.google.com/s2/favicons?sz=64&domain=e-hentai.org
// @homepage     https://github.com/smartacephale/sleazy-fork#readme
// @homepageURL  https://sleazyfork.org/en/users/1253342-smartacephale
// @source       https://github.com/smartacephale/sleazy-fork
// @supportURL   https://github.com/smartacephale/sleazy-fork/issues
// @match        https://*.e-hentai.org/*
// @require      https://cdn.jsdelivr.net/npm/[email protected]/dist/core/pervertmonkey.core.umd.js
// @grant        GM_addStyle
// @grant        unsafeWindow
// @run-at       document-idle
// ==/UserScript==

var ___core = window.pervertmonkey.core || pervertmonkey.core;
var ___utils = ___core;


(function(___core, ___utils) {
	"use strict";
	new ___core.Rules({
		thumbs: { selector: ".gl1t" },
		thumb: { selectors: { title: ".glname" } },
		thumbImg: { selector: "data-lazy-load" },
		containerSelectorLast: ".itg.gld",
		paginationStrategyOptions: createPaginationStrategyOptions(),
		schemeOptions: [
			"Title Filter",
			"Badge",
			"Advanced"
		]
	});
	function createPaginationStrategyOptions() {
		let nextLink;
		function getNextLink(doc = document) {
			return [...doc.querySelectorAll("a#dnext[href]")].pop()?.href;
		}
		function getPaginationUrlGenerator() {
			const paginationUrlGenerator = async (_) => {
				if (!nextLink) {
					nextLink = getNextLink();
					return nextLink;
				}
				nextLink = getNextLink(await (0, ___utils.fetchHtml)(nextLink));
				return nextLink;
			};
			return paginationUrlGenerator;
		}
		const totalTitles = Number.parseInt(getNextLink()?.match(/\d+$/)?.[0] || "0");
		return {
			paginationSelector: ".searchnav + div + .searchnav",
			overwritePaginationLast: () => totalTitles,
			getPaginationUrlGenerator
		};
	}
	function setThumbnailMode() {
		if (!(/f_search/.test(location.search) || /^\/tag\//.test(location.pathname))) return;
		const selectInputT = document.querySelector("option[value=t]");
		if (selectInputT) {
			const select = selectInputT.parentElement;
			if (select.value === "t") return;
			select.value = "t";
			select.dispatchEvent(new Event("change"));
		}
	}
	setThumbnailMode();
})(___core, ___utils);