Instantly share code, notes, and snippets.

Embed
What would you like to do?
// ==UserScript==
// @name EmuParadise Download Workaround - 1.1.1
// @version 1.1.2
// @description Replaces the download button link with a working one
// @author Eptun
// @match https://www.emuparadise.me/*/*/*
// @require http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js
// @grant none
// ==/UserScript==
(function() {
'use strict';
var id = ((document.URL).split("/"))[5];
$(".download-link").prepend(`<a target="_blank" href="/roms/get-download.php?gid=`+id+`&test=true" title="Download using the workaround script">Download using the workaround script</a><br><br>`);
})();
@sheeit

This comment has been minimized.

Copy link

sheeit commented Nov 4, 2018

Re-write with no jQuery:

// ==UserScript==
// @name	EmuParadise Download Workaround - 0.0.1
// @version	0.0.1
// @description	Replaces the download button link with a working one
// @author	strupo (based on Epton (https://gist.github.com/Eptun/3fdcc84552e75e452731cd4621c535e9/))
// @match	https://www.emuparadise.me/*/*/*
// @grant	none
// ==/UserScript==

(function() {
	'use strict';

	var id = encodeURIComponent(((document.URL).split('/'))[5]);
	var suf = '<a target="_blank" href="/roms/get-download.php'
		+ '?gid=' + id
		+ '&test=true"'
		+ ' title="Download using the workaround script">'
		+ 'Download using the workaround script</a>'
		+ '<br /><br />';
	Array.from(
		document.getElementsByClassName('download-link')
	).map(dl => {
		dl.innerHTML = suf + dl.innerHTML;
	});
})();
@xivchrixx

This comment has been minimized.

Copy link

xivchrixx commented Jan 29, 2019

uhm sir why this wont work it only open to new tab

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment