// ==UserScript==
// @name IGG Games Direct Downloads
// @namespace http://tampermonkey.net/
// @version 0.1
// @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.
// @author MooreR
// @include http://igg-games.com/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
$('#sidebar').remove();
$('.flexslider').remove();
$('.fixed.c2right #primary-content').css('width', 'auto');
var linkSections;
var i = 0;
var allLinks = $('a[rel*=\'nofollow\']');
for (i = 0; i < allLinks.length; i++) {
linkSections = decodeURIComponent(allLinks[i].href).split('://'); //decodeURLs, then split them up by the url forwarding seperators.
if (linkSections.length >= 3) {
allLinks[i].setAttribute('href', '//' + linkSections[linkSections.length - 1]);
}
}
window.addEventListener('load', function() {
window.open = null;
$('document').onclick = null;
$('MsoPFwqg').remove(); //disable popup ads.
console.log('removed bull shit');
var strVar = "";
strVar += "<div class=\"search-form\" role=\"search\">";
strVar += " <form method=\"get\" class=\"search-form clear-block\" action=\"http:\/\/igg-games.com\/\" _lpchecked=\"1\">";
strVar += " <input type=\"submit\" class=\"submit\" title=\"Search Website\" value=\"\">";
strVar += " <fieldset>";
strVar += " <input type=\"text\" name=\"s\" data-default=\"Search Website\" class=\"text alignleft clearField suggestTerms clearFieldBlurred\" value=\"\">";
strVar += " <input type=\"hidden\" value=\"submit\">";
strVar += " <\/fieldset>";
strVar += " <\/form>";
strVar += "<\/div>";
$(".page-content").append(strVar);
}, false);
})();
Comments