Skip to content

Instantly share code, notes, and snippets.

@Drethek
Last active October 20, 2018 15:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Drethek/1363c7855037959fe0a9ad6e4005c6df to your computer and use it in GitHub Desktop.
Save Drethek/1363c7855037959fe0a9ad6e4005c6df to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name IGG-Games.com Direct Downloads
// @namespace http://tampermonkey.net/
// @version 1.0.6
// @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 [http://moorer-software.com]
// @include http://igg-games.com/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
var linkSections;
var i = 0;
var allLinks = $('a');
if(allLinks.length != 0){
$.each( allLinks, function( key, value ) {
if(value.href.indexOf('xurl=') != -1){
//console.log(value.href);
var linkSections = value.href.split('://');
value.setAttribute('href', '//' + decodeURIComponent(linkSections[2]));
}
});
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment