antizapret.info links

Adds hyperlinks to the blocked pages. Note that this is a lazy attempt and doesn't pretend to have good code.

06.11.2016 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.

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

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         antizapret.info links
// @namespace    http://tampermonkey.net/
// @version      0.06
// @description  Adds hyperlinks to the blocked pages. Note that this is a lazy attempt and doesn't pretend to have good code.
// @author       紫
// @match        https://antizapret.info/
// @match        https://antizapret.info/?*
// @match        https://antizapret.info/org.php*
// @match        https://antizapret.info/minjust.php*
// @grant        GM_xmlhttpRequest
// ==/UserScript==

(function() {
    'use strict';
    var trs, td, link;

    trs = document.getElementsByTagName('tbody')[0].getElementsByTagName('tr');
    for (var i = 0, len = trs.length; i < len; i++) {
        td = trs[i].getElementsByTagName('td')[1];
        link = td.getElementsByTagName('a')[0];
        td.insertBefore(extSiteLink(link.text), link);
    }

    function extSiteLink(link_url) {
        var link_node, img_node;

        img_node = document.createElement('img');
        img_node.src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAFZJREFUeF59z4EJADEIQ1F36k7u5E7ZKXeUQPACJ3wK7UNokVxVk9kHnQH7bY9hbDyDhNXgjpRLqFlo4M2GgfyJHhjq8V4agfrgPQX3JtJQGbofmCHgA/nAKks+JAjFAAAAAElFTkSuQmCC';
        link_node = document.createElement('a');
        link_node.style.marginRight = '5px';
        link_node.href = 'http://';
        if (link_url.length >= 50) {
            new GM_xmlhttpRequest({
                method: 'GET',
                url: 'http://api.' + window.location.host + '/get.php?type=json&item=' + link_url,
                onload: function(response) {
                    link_node.href = JSON.parse(response.responseText).register[0].url;
                }
            });
        } else {
            link_node.href = 'http://' + link_url;
        }
        link_node.target = '_blank';
        link_node.appendChild(img_node);
        return link_node;
    }
})();