Exhentai AiDetector

Detects AI generated content on e-hentai and highlights it

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         Exhentai AiDetector
// @namespace    B1773rm4n
// @version      2025-12-24
// @description  Detects AI generated content on e-hentai and highlights it
// @copyright    WTFPL
// @license      WTFPL
// @source       https://github.com/B1773rm4n/Tampermonkey_Userscripts/blob/main/ehentai_AiDetector.js
// @author       B1773rm4n
// @match        https://exhentai.org/*
// @match        https://e-hentai.org/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=exhentai.org
// @grant        none
// ==/UserScript==

(function () {
    'use strict';

    // If on a gallery page itself
    if (document.URL.includes("\/g\/")) {
        console.log("gallery view")
        let title = document.getElementById("gn").innerText
        let tag;
        try {
            tag = document.getElementById("ta_other:ai_generated").innerText
        } catch (err) {
            tag = ""
        }

        if (title.includes("AI Generated") || tag.includes("ai generated")) {
            document.body.style.color = "#F00"
            document.body.style.backgroundColor = "#400"
            document.getElementById("gdt").style.backgroundColor = "#400"
        }

        // redirect to exhentai

        if (window.location.toString().indexOf('e-hentai') > -1) {
            let newLocation = window.location.toString().replace('e-hentai', 'exhentai')
            window.location.replace(newLocation)
        }
    }

    // If on the overview of galleries
    if (document.URL.includes("advsearch") || document.URL.includes("tag") || document.URL.includes("popular")) {
        console.log("list view")
        // let galleryList = document.getElementsByClassName("glname")
        // this does the same as the commented line above but returns an array
        let galleryList = [...document.querySelectorAll('.glname')]

        galleryList.forEach(function (galleryItem, index) {
            if (galleryItem.innerText.toLowerCase().includes("ai generated") || galleryItem.innerText.toLowerCase().includes("ai-generated")) {
                galleryItem.parentElement.parentElement.style.backgroundColor = "#400"
            }
        })

    }

})();