Namespace Hiding

Hides namespaces

اعتبارا من 18-05-2021. شاهد أحدث إصدار.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

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.

ستحتاج إلى تثبيت إضافة مثل Stylus لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتتمكن من تثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

(لدي بالفعل مثبت أنماط للمستخدم، دعني أقم بتثبيته!)

// ==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));
    }
})();