Replaces inline JS on powerline.io
// ==UserScript==
// @name powerline.io speed turn
// @namespace http://tampermonkey.net/
// @version 0.7
// @description Replaces inline JS on powerline.io
// @author Dalrae <Dalrae#1843>, Thanks Guy for making the js replacement!
// @match *://powerline.io/*
// @grant unsafeWindow
// @run-at document-start
// ==/UserScript==
var evilJSRegex = /SpaceWars/;
var replacementJSUrl = "https://cdn.discordapp.com/attachments/598249319006470158/793032675966320640/FastTurnPowerline.js";
function removeInlineJS(e) {
if (evilJSRegex.test(e.target.innerText)) {
// Stop the default JS from running
e.stopPropagation();
e.preventDefault();
// Create a new script tag for our custom JS
var awesomeJS = document.createElement("script");
awesomeJS.type = "text/javascript";
awesomeJS.src = replacementJSUrl;
// Replace the old JS with our custom shiznit
var parentNode = e.target.parentNode;
parentNode.removeChild(e.target);
parentNode.appendChild(awesomeJS);
// Remove the event listener
window.removeEventListener("beforescriptexecute", removeInlineJS, true);
}
}
(function() {
'use strict';
window.addEventListener("beforescriptexecute", removeInlineJS, true);
})();