Moorer

IGG Games Tampermonkey Script

Oct 20th, 2016
531
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name         IGG Games Direct Downloads
  3. // @namespace    http://tampermonkey.net/
  4. // @version      0.1
  5. // @description  IGG Games download links all contain multiple forwarders before you get the actual download link. This automatically re-formats each available download link to be direct.
  6. // @author       MooreR
  7. // @include      http://igg-games.com/*
  8. // @grant        none
  9. // ==/UserScript==
  10. (function() {
  11.     'use strict';
  12.  
  13.  
  14.     $('#sidebar').remove();
  15.     $('.flexslider').remove();
  16.     $('.fixed.c2right #primary-content').css('width', 'auto');
  17.  
  18.  
  19.     var linkSections;
  20.     var i = 0;
  21.     var allLinks = $('a[rel*=\'nofollow\']');
  22.     for (i = 0; i < allLinks.length; i++) {
  23.         linkSections = decodeURIComponent(allLinks[i].href).split('://'); //decodeURLs, then split them up by the url forwarding seperators.
  24.         if (linkSections.length >= 3) {
  25.             allLinks[i].setAttribute('href', '//' + linkSections[linkSections.length - 1]);
  26.         }
  27.     }
  28.     window.addEventListener('load', function() {
  29.         window.open = null;
  30.         $('document').onclick = null;
  31.         $('MsoPFwqg').remove(); //disable popup ads.
  32.         console.log('removed bull shit');
  33.  
  34.         var strVar = "";
  35.         strVar += "<div class=\"search-form\" role=\"search\">";
  36.         strVar += "  <form method=\"get\" class=\"search-form clear-block\" action=\"http:\/\/igg-games.com\/\" _lpchecked=\"1\">";
  37.         strVar += "    <input type=\"submit\" class=\"submit\" title=\"Search Website\" value=\"\">";
  38.         strVar += "    <fieldset>";
  39.         strVar += "      <input type=\"text\" name=\"s\" data-default=\"Search Website\" class=\"text alignleft clearField suggestTerms clearFieldBlurred\" value=\"\">";
  40.         strVar += "      <input type=\"hidden\" value=\"submit\">";
  41.         strVar += "    <\/fieldset>";
  42.         strVar += " <\/form>";
  43.         strVar += "<\/div>";
  44.  
  45.  
  46.         $(".page-content").append(strVar);
  47.  
  48.     }, false);
  49.  
  50. })();
Advertisement
Add Comment
Please, Sign In to add comment