Tag Hiding

Hides Tags/Namespaces via regex

18.05.2021 itibariyledir. En son verisyonu görün.

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

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.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name         Tag Hiding
// @version      1.04
// @description  Hides Tags/Namespaces via regex
// @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 (var i = 0; i < data.length; i++) {
            if (data[index] == undefined) continue;
            var str = data[index].href.split('/');
            reqList[i] = [str[4], str[5]];
            index++;
        }
        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[index]).css({display: 'none'});
                        }
                    }
                } else {
                    console.error();
                }
            }
        }
        req.open("POST", document.location.origin + "/api.php", true);
        req.send(JSON.stringify(request));
    }
})();