Created
December 13, 2021 02:10
-
-
Save tacohitbox/75334a0e5b80044fae43f4bf7b177fbc to your computer and use it in GitHub Desktop.
Userscript to download from retrogames.cc.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name RetroGames.cc Downloader | |
// @version 1.0 | |
// @description try to take over the world! | |
// @author tacohitbox | |
// @match https://www.retrogames.cc/*-games/* | |
// @icon https://www.google.com/s2/favicons?domain=retrogames.cc | |
// @grant none | |
// ==/UserScript== | |
if (document.querySelector(".start-game")) { | |
var b = document.createElement("br"); | |
var dl = document.createElement("button"); | |
dl.classList.add("button"); | |
dl.classList.add("large"); | |
dl.innerHTML = "Download Game"; | |
dl.onclick = function() {dlGame();} | |
document.querySelector(".game-container").append(b); | |
document.querySelector(".game-container").append(dl); | |
} | |
function dlGame() { | |
var s = `https:${document.querySelector(".game-container script").innerHTML.split(`'src', '`)[2].split(`').css`)[0]}`; | |
var x = new XMLHttpRequest(); | |
x.open("GET", s); | |
x.send(); | |
x.onload = function() { | |
var u = x.responseText.split(`EJS_gameUrl = '`)[1].split(`'`)[0]; | |
window.open(u, "_self"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment