Redirect remover

Bypass redirected links.

2015-04-14 या दिनांकाला. सर्वात नवीन आवृत्ती पाहा.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name         Redirect remover
// @version      1.5.3
// @description  Bypass redirected links.
// @namespace    idmresettrial
// @author       idmresettrial
// @run-at       document-end
// @require      http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js
// @grant        none

// Website list

// @include      http://vozforums.com/*
// @include      http://sinhvienit.net/*
// @include      http://forum.vietdesigner.net/threads/*
// @include      http://adf.ly/*
// @include      http://phienbanmoi.com/*
// @include      http://acer-a500.ru/*
// @include      http://vegaviet.com/redirect/?to=*
// @include      /^https*:\/\/www.fshare.vn.+/


// @include       /^https*:\/\/.+\/.*booking.+london/

// End list


// ==/UserScript==

this.$ = this.jQuery = jQuery.noConflict(true);

// Do not run on frames or iframes
if (window.top !== window.self) {
    return;
}

document.addEventListener("DOMContentLoaded", function() {

    site = window.location.hostname;

    switch (site)
    {
        case "vozforums.com":
        case "sinhvienit.net":
        case "phienbanmoi.com":
        case "forum.vietdesigner.net":
            {
                atag = document.getElementsByTagName("a");

                for (i=0;i<atag.length;i++)
                {
                    url = unescape(atag[i].href);
                    if (site === "forum.vietdesigner.net") url = unescape(url);

                    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;
                    gogogo(url);
                }
                break;
            }
        case "acer-a500.ru":
            {
                atag = document.getElementsByTagName("a");

                for (i=0;i<atag.length;i++)
                {
                    url = unescape(atag[i].href);
                    redirect = "http://acer-a500.ru/engine/redir/index/leech_out.php?a:";
                    if (url.indexOf(redirect) === 0) {
                        atag[i].href = window.atob(url.substring(redirect.length,url.length));
                    }
                }
                break;
            }
        case "www.fshare.vn":
            {
                csrf = $('input[name="fs_csrf"]');
                if (csrf.length) {
                    csrf = csrf.attr('value');
                    data = {speed: 'slow', fs_csrf: csrf};
                    $.post('/download/index', data).success(function(data){
                        $('<button class="btn-red free-btn download_btn" style="margin-bottom: 15px; display:none;" id="rrdownload"><div>Tải ngay (Redirect remover)</div></button>').insertBefore('button.download_btn');
                        $('#rrdownload').fadeIn();
                        $('#rrdownload').click(function() {window.location.replace(data.url);});
                    });
                }
                break;
            }
        case "vegaviet.com":
            {
                url = $('.message b').eq(1).html();
                gogogo(url);
                break;
            }

        default:
            {
                if ( (/^https*:\/\/.+\/.*booking.+london/).test(window.location.href) ) {
                    selector = {"baomoitoday.com":'div[align="center"][style="padding:5px"] a', "travelworld24h.com":"div.cms-content a", "default":"center a"};
                    if (typeof selector[site] === "undefined") site = "default";
                    url = $(selector[site]).attr('href');
                    if (typeof(url) !== 'undefined') gogogo(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;
}

function gogogo(url) {
    $('body').html('<h1>Đang chuyển hướng đến trang gốc...</h1>');
    window.location.replace(url);
}