Namespace Hiding

Hides namespaces

Stan na 18-05-2021. Zobacz najnowsza wersja.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name         Namespace Hiding
// @version      1.00
// @description  Hides namespaces
// @author       Hauffen
// @include      /https?:\/\/(e-|ex)hentai\.org\/.*/
// @require      https://code.jquery.com/jquery-3.4.1.min.js
// @namespace https://greasyfork.org/users/285675
// ==/UserScript==

(function() {
    let $ = window.jQuery, index = 0;
    let elements = $('div[class^="gl1"]');
    let data = $('div[class^="gl1"] > a');

    for (var i = 0; i < data.length / 25; i++) { // In case you have more than 25 elements per page
        hide();
    }

    function hide() {
        var reqList = [];
        for (index; index < data.length; index++) {
            if (data[index] == undefined) continue;
            var str = data[index].href.split('/');
            reqList[index] = [str[4], str[5]];
        }
        var request = {"method": "gdata", "gidlist": reqList, "namespace": 1};

        var req = new XMLHttpRequest();
        req.onreadystatechange = e => {
            if (req.readyState == 4) {
                if (req.status == 200) {
                    var apirsp = JSON.parse(req.responseText);
                    for (var i = 0; i < apirsp.gmetadata.length; i++) {
                        if (apirsp.gmetadata[i].tags.some(tag => /^parody:/.test(tag))) { // Edit the /^parody:/ to whatever you want
                            $(elements[i]).css({display: 'none'});
                        }
                    }
                } else {
                    console.error();
                }
            }
        }
        req.open("POST", document.location.origin + "/api.php", true);
        req.send(JSON.stringify(request));
    }
})();