Guest User

k2nblog-ad-skipper.user

a guest
Mar 17th, 2016
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name        k2nblog ad skipper
  3. // @namespace   http://k2nblog.com/ad-skipper
  4. // @description Skip ads on sh.st, j.gs and adf.ly
  5. // @include     http://sh.st/*
  6. // @include     http://j.gs/*
  7. // @include     http://adf.ly/*
  8. // @version     0.0.1
  9. // @grant       none
  10. // ==/UserScript==
  11.  
  12. // Written by deobfuscating adf.ly code.
  13. function decodeLink(cipher) {
  14.   var C = "";
  15.   var Z = "";
  16.   var i, len = cipher.length;
  17.   for (i = 0; i < len; ++i) {
  18.     if (i & 1) {
  19.       Z = cipher[i] + Z;
  20.     } else {
  21.       C += cipher[i];
  22.     }
  23.   }
  24.   return atob(C + Z).slice(2);
  25. }
  26.  
  27. if (location.host === "sh.st") {
  28.   var m = location.pathname.match(/\/(https?:.+)/);
  29.   if (m) {
  30.     location.href = m[1];
  31.   }
  32. } else if (location.host === "j.gs" || location.host === "adf.ly") {
  33.   var m = location.href.match(/\/ad\/locked.*\?url=(\w+)/);
  34.   if (m) {
  35.     // adf.ly doesn't reveal links too often.
  36.     setTimeout(function() {
  37.       location.href = "/" + m[1];
  38.     }, 2000);
  39.   } else if (window.ysmm) {
  40.     location.href = decodeLink(ysmm);
  41.   }
  42. }
Add Comment
Please, Sign In to add comment