Redirect remover

Modify redirect link to be direct one.

目前为 2015-01-02 提交的版本。查看 最新版本

// ==UserScript==
// @name         Redirect remover
// @version      0.52
// @description  Modify redirect link to be direct one.
// @namespace    idmresettrial
// @author       idmresettrial
// @run-at       document-end
// @grant        none

// Website list

// @match        *://*.vozforums.com/*
// @match        *://*.sinhvienit.net/*
// @match        *://*.adf.ly/*

// End list


// ==/UserScript==

site = window.location.hostname;

switch (site)
{
    case "vozforums.com":
    case "sinhvienit.net":    
        {
            atag = document.getElementsByTagName("a");
            
            for (i=0;i<atag.length;i++)
            {
                url = unescape(atag[i].href);
                redirect = /[?=]http/i;
                if (redirect.test(url)) {
                    atag[i].href = url.replace(/http\S+[?=]http/i,"http");
                }
            }
            break;
        }
    case "adf.ly":
        {
            
            url = decode_adly();
            if (url.length>0)
            {
                window.onbeforeunload = null;
                window.onunload = null;
                window.location = url;
            }
            break;
        }
}

function decode_adly()
{
    url="";
    if (window.ysmm)
    {
        ysmm = window.ysmm;
        url0 = ""; url1 = "";
        for (i=0;i<ysmm.length;i++)
        {
            if (i%2===0)
            {
                url0 +=ysmm.charAt(i);
                url1 +=ysmm.charAt(ysmm.length-1-i);
            }
        }
        url = window.atob(url0 + url1);
        url = url.substring(2,url.length);
    }
    return url;
}

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址