powerline.io speed turn

Replaces inline JS on powerline.io to creat a speed turn!

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         powerline.io speed turn
// @namespace    http://tampermonkey.net/
// @version      0.7
// @description  Replaces inline JS on powerline.io to creat a speed turn!
// @author     	 Xmusic
// @match        *://powerline.io/*
// @grant        unsafeWindow
// @run-at       document-start
// ==/UserScript==
 
var evilJSRegex = /SpaceWars/;
var replacementJSUrl = "https://drive.google.com/uc?export=view&id=13Cjc3PZ0oeSQ3DZk-aCJQhSCn4QRkEWR";
 
function removeInlineJS(e) {	
    if (evilJSRegex.test(e.target.innerText)) {
        console.log("It worked!!!")
        // 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);
})();