Greasy Fork

Greasy Fork is available in English.

Mangadex Group Blocker

To block groups on Mangadex's latest releases page

当前为 2021-08-23 提交的版本,查看 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name        Mangadex Group Blocker
// @namespace   Violentmonkey Scripts
// @match       https://mangadex.org/titles/latest*
// @require     http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js
// @require     http://greasyfork.icu/scripts/31940-waitforkeyelements/code/waitForKeyElements.js?version=209282
// @grant       none
// @version     1.1
// @author      Onemanleft
// @description To block groups on Mangadex's latest releases page
// ==/UserScript==

// Start and end are the formats for the relevant element on the page.
const start = "#__layout > div > div.flex-grow.flex.flex-col.flex-shrink > div.flex-grow > div > div:nth-child(2) > div.mb-12 > div:nth-child(";
const end = ") > div > div.chapter-feed__chapters > div > div:nth-child(1) > div > div:nth-child(3) > div > div";
// Wait for the chapters to be loaded.
waitForKeyElements(".flex-grow", function () {
try {
	// Max 100 entries per page.
	for (let i = 1; i <= 100; i++) {
		// This shows the group name.
		switch (document.querySelector(start + i + end).innerText) {
		// The groups you want to block.
			case "Bilibili Comics":
			/* To block more groups add a line after 'case "Bilibili Comics":' like
			case "Test":
			It IS a COLON (:) NOT a SEMICOLON (;)
			*/
			// This blocks the element if it matches the group name.
			document.querySelector(start + i + ")").style.display="none";
		}
	}
}
catch (e) {
	// Error will probably be <TypeError: Cannot read property 'innerText' of null> at F12 console probably meaning it got to the end of the page.
	console.log(e);
}});