Redirect remover

Tính năng: xoá redirect link

目前为 2016-04-20 提交的版本。查看 最新版本

// ==UserScript==
// @name         Redirect remover
// @version      1.7.8.8
// @description  Tính năng: xoá redirect link
// @namespace    idmresettrial
// @author       idmresettrial
// @run-at       document-start
// @require      http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js
// @grant        GM_addStyle
// @icon         http://i.imgur.com/cnWhhD8.png
// Website list
// @include       *
// End list
// ==/UserScript==
var site = window.location.hostname;
site = site.replace(/[^.]+\.deviantart\.com/i, 'www.deviantart.com');
if (window.top !== window.self && site !== 'www.google.com') {
  return;
}
this.$ = this.jQuery = jQuery.noConflict(true);
document.addEventListener('DOMContentLoaded', function () {
  switch (site)
    {
    case 'vozforums.com':
    case 'sinhvienit.net':
    case 'phienbanmoi.com':
    case 'forum.vietdesigner.net':
    case 'www.webtretho.com':
    case 'chiaseit.vn':
    case 'www.hdvietnam.com':
    case 'www.deviantart.com':
      {
        $('a').each(function () {
          url = unescape($(this).attr('href'));
          if (site === 'forum.vietdesigner.net' || site === 'chiaseit.vn') url = unescape(url);
          redirect = /[?=]http/i;
          if (redirect.test(url)) {
            $(this).attr('href', url.replace(/^.+[?=]http/i, 'http'));
          }
        });
        var particular = {
          'vozforums.com': function () {
            var errPage = [
              'vozForums Database Error',
              '502 Bad Gateway',
              '500 Internal Server Error'
            ];
            if (errPage.indexOf(document.title) > - 1) {
              document.title = 'Connecting... - By Redirect Remover';
              setTimeout(function () {
                location.reload();
              }, 2000);
            }
          },
          'sinhvienit.net': function () {
            if ($('form[name=vtlai_firewall]').length) {
              $('#btnSubmit1').click();
            }
          }
        };
        if (Object.keys(particular).indexOf(site) > - 1) particular[site]();
        break;
      }
    case 'adf.ly':
    case 'q.gs':
    case 'chathu.apkmania.co':
      {
        var url = '';
        speedUp();
        t = setInterval(function () {
          url = $('#skip_button').attr('href') || '';
          if (url.length) {
            clearInterval(t);
            window.onbeforeunload = null;
            window.onunload = null;
            gogogo(url);
          }
        }, 1000);
        break;
      }
    case 'linkshrink.net':
      {
        url = $('#skip a.bt').attr('href');
        if (url.length) gogogo(url);
        break;
      }
    case 'www.oni.vn':
      {
        domain = window.location.protocol + '//' + window.location.host + '/';
        $.ajax({
          type: 'GET',
          url: domain + 'click.html',
          data: $('html').html().match(/code=([^"]+)/i) [0],
          contentType: 'application/json; charset=utf-8',
          success: function (html) {
            url = html;
            gogogo(url);
          }
        });
        break;
      }
    case 'ouo.io':
      {
        url = $('a#btn-main').attr('href');
        gogogo(url);
        break;
      }
    case 'www.google.com':
      {
        if (!(/(9gag\.com|vechai\.info)/gi).test(document.referrer)) {
          setTimeout(function () {
            bVerify = $('div.recaptcha-checkbox-checkmark');
            if (bVerify.length) bVerify.click();
          }, 1000);
        }
        break;
      }
    case 'acer-a500.ru':
    case 'vegaviet.com':
      {
        $('a').each(function () {
          url = unescape($(this).attr('href'));
          redirect = {
            'acer-a500.ru': 'http://acer-a500.ru/engine/redir/index/leech_out.php?a:',
            'vegaviet.com': 'http://vegaviet.com/redirect/?to='
          };
          if (url.indexOf(redirect[site]) === 0) {
            $(this).attr('href', window.atob(url.substring(redirect[site].length, url.length)));
          }
        });
        break;
      }
    case 'www.fshare.vn':
      {
        if ($('.file-info').length) {
          csrf = $('input[name="fs_csrf"]');
          if (csrf.length) {
            csrf = csrf.attr('value');
            data = {
              ajax: 'download-form',
              'DownloadForm[pwd]': '',
              fs_csrf: csrf
            };
            t = setInterval(function () {
              $.post('/download/get', data, function (data) {
                if (typeof data.url !== 'undefined') {
                  clearInterval(t);
                  insert = $('#download-form').parent();
                  $('<div class="col-xs-4" id="rrdownload"><a data-toggle="modal" href="#" class="btn btn-success btn-lg btn-block clearfix"><i class="fa fa-cloud-download fa-2x animated pulse infinite pull-left"></i><span class="pull-right text-right">Tải miễn phí<br><small>(redirect remover)</small></span></a></div>').insertBefore(insert);
                  $('#rrdownload').click(function () {
                    window.location.replace(data.url);
                  });
                }
              });
            }, 1000);
          }
        }
        break;
      }
    case 'www.facebook.com':
      {
        $('body').on('mouseenter', 'a[onmouseover^="LinkshimAsyncLink.swap"]', function () {
          $(this) [0].removeAttribute('onclick');
          $(this) [0].removeAttribute('onmouseover');
          $(this) [0].outerHTML += '';
        });
        break;
      }
    case 'muare.vn':
      {
        $('a.ProxyLink').removeClass('ProxyLink');
        break;
      }
    case 'www.vn-zoom.com':
      {
        $('a[href^="http://www.mediafire.com/"]').click(function (e) {
          e.preventDefault();
          $('body').append('<iframe style="visibility:hidden" id="rr-mf" src="about:blank"></iframe>').find('iframe#rr-mf').contents().find('body').append('<a onclick="window.open(this.href);return false;" target="_blank"></a>').find('a').attr('href', $(this).attr('href')) [0].click();
          $('iframe#rr-mf').remove();
        });
        $('img[src*="i.imgur.com/"]').each(function () {
          $(this).attr('src', $(this).attr('src').replace('http://i.imgur.com/', 'http://kageurufu.net/imgur/?'));
        });
        break;
      }
    case 'linksvip.net':
      {
        if (window.location.href.indexOf('linksvip.net/dl') > - 1) {
          setTimeout(function () {
            url = $('a.linkvip').attr('href');
            if (url.length && url.indexOf('linksvip.net') > - 1) {
              gogogo(url);
            }
          }, 1000);
        }
        if (window.location.href.indexOf('linksvip.net/get-link') > - 1) {
          url = $('#skip a.bt').attr('href');
          if (url.length) {
            gogogo(url);
          }
        }
        if (window.location.href.indexOf('&ref=idmresettrial') > - 1) {
          var alert = (function alert() {
            window.location.href = $('#a_down').attr('href');
          }).toString();
          var script = document.createElement('script');
          script.innerHTML = alert;
          document.head.appendChild(script);
        }
        break;
      }
    case 'srnk.co':
      {
        if (window.location.href.indexOf('srnk.co/i') > - 1) {
          speedUp();
          setTimeout(function () {
            $('#btn-with-link').click();
          }, 10000);
        }
        break;
      }
    default:
      {
        /*
        //if ($('body').text().match(/\b(london|hotel|deal)s?\b/gi).length > 5) {
        selector = {
          'baomoitoday.com': 'div[align="center"][style="padding:5px"] a',
          'travelworld24h.com': 'div.cms-content a',
          'kenhphunu180.com': 'center a, div#news_main a, strong a, div.main_content a'
        };
        //if (typeof selector[site] === 'undefined') site = 'default';
        url = $(selector[site]).attr('href');
        gogogo(url);
        //}
        */
        break;
      }
  }
  // fshare link

  $('a[href^="https://www.fshare.vn/file"]').each(function () {
    $('<a target="_blank" href="http://linksvip.net/?link=' + $(this).attr('href') + '&ref=idmresettrial" style="display:inline-block; margin:0px 5px; padding:0px 5px; background:#fff; border:1px solid #cdcdcd; border-radius:3px; color:#7e7e7e; font-size:10px; line-height:15px;">Get vip link</a>').insertAfter($(this));
  });
});
function gogogo(url) {
  if (typeof url !== 'undefined') {
    if (url.length === 0) return;
    page = '' +
    '<html><head><title>Đang chuyển hướng...</title>' +
    '<style type="text/css">' +
    'div#rr{margin:10px;}a{text-decoration:none;color:#000}.ellipsis{overflow:hidden;display:inline-block;vertical-align:bottom;-webkit-animation:ellipsis 1s infinite;-moz-animation:ellipsis 1s infinite}@-webkit-keyframes ellipsis{from{width:2px}to{width:12px}}@-moz-keyframes ellipsis{from{width:2px}to{width:12px}}' +
    '</style>' +
    '</head><body>' +
    '<div style="background-image:url(http://i.imgur.com/qflyJA3.gif?r=' + (new Date().getTime()) + ')"></div>' + // Redirect removed count
    '<div id="rr"><b>Đang chuyển hướng đến <a href="' + url + '">trang gốc</a></b><span class="ellipsis">...</span></div>' +
    '</body></html>';
    $('html').html(page);
    $(window).unload(function () {
      $('title').html(url);
      $('body').html('');
    });
    window.location.replace(url);
  }
}
function speedUp() {
  var tmp = (function () {
    oSetInterval = setInterval;
    setInterval = function (fn, delay) {
      oSetInterval(fn, 10);
    };
  }).toString();
  $('head').append('<script>(' + tmp + ')()</script>');
}

QingJ © 2025

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