Healthy Hentai

Remove Bloody Galleries In hitomi

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

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

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

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.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name                Healthy Hentai
// @name:zh-CN          Healthy Hentai
// @description         Remove Bloody Galleries In hitomi
// @description:zh-CN   移除 hitomi 中含有血腥标签的图集
// @version             0.1.0
// @author              jferroal
// @license             GPL-3.0
// @include             https://hitomi.la/*
// @run-at              document-idle
// @namespace           https://greasyfork.org/users/34556
// ==/UserScript==

(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
(function () {
  function hideGalleryContainTags(galleries, tags = ['guro', 'blood']) {
    galleries.forEach((node) => {
      const galleryTags = Array.from(node.querySelectorAll('.relatedtags > ul > li')).map((e) => e.innerText);
      if (galleryTags.some((gt) => tags.some((t) => (new RegExp(t, 'gi')).test(gt)))) {
        node.style.display = 'none';
      }
    });
  }

  function startCheck() {
    let tryTimes = 0;
    let checkInterval = setInterval(() => {
      const galleries = Array.from(document.querySelectorAll('.gallery-content > div'));
      if (!galleries.length) {
        tryTimes += 1;
      }
      if (tryTimes > 20 || galleries.length) {
        hideGalleryContainTags(galleries);
        clearInterval(checkInterval);
        checkInterval = null;
      }
    }, 500);
  }

  // listen page button click
  window.addEventListener('click', startCheck);
  // window.addEventListener('scroll', startCheck);
  startCheck();
})();
},{}]},{},[1]);