=================================================================== --- Bieżąca wersja +++ Nowa wersja @@ -1,22 +1,20 @@ // ==UserScript== // @name Gargonem - dodatki Priweejta // @namespace http://tampermonkey.net/ -// @version 0.6 +// @version 0.3 // @description Zestaw dodatków do nowego i starego interfejsu w grze Margonem // @author Priw8 // @match https://*.margonem.pl/ // @exclude https://www.margonem.pl/ // @icon https://www.google.com/s2/favicons?sz=64&domain=margonem.pl // @grant GM_setValue // @grant GM_getValue // @grant GM_deleteValue -// @grant GM_listValues // @grant unsafeWindow // ==/UserScript== !function() { - const version = 0.6; const window = unsafeWindow; const gargonemMainSrc = "https://priw8.com/margo/gargonem/dist/main.js"; @@ -56,10 +54,8 @@ if (gmPrivilegedScripts.includes(src)) { $script.GM_setValue = GM_setValue; $script.GM_getValue = GM_getValue; $script.GM_deleteValue = GM_deleteValue; - $script.GM_listValues = GM_listValues; - $script.loaderVersion = version; $script.gargonem = true; $script.addScript = addScript; } $script.src = `${src}?v=${scriptVersion}`; @@ -74,36 +70,13 @@ function addScript(src) { scriptsToLoad.push(src); } - function firefoxFix_waitUntilFullyLoaded() { - // On firefox, the userscript may somehow be executed while Engine exists but not Engine.communication - if (interfaceKind == InterfaceKind.NEW && typeof window.Engine.communication == "undefined") { - return new Promise(resolve => { - Object.defineProperty(window.Engine, "communication", { - get() { - return null; - }, - set(v) { - console.log(`[GargonemFirefoxFix]: Engine.communication loaded`); - delete window.Engine.communication; - window.Engine.communication = v; - resolve(); - return true; - }, - configurable: true - }) - }); - } - } - let overwrittenFunction = null; let overwrittenFunctionThis = null; let overwrittenFunctionArgs = null; let wasOverwrittenFunctionCalled = false; - async function beginLoading() { - await firefoxFix_waitUntilFullyLoaded(); - + function beginLoading() { // Block game loading until all scripts are loaded if (interfaceKind == InterfaceKind.OLD) { overwrittenFunction = window.startGame; window.startGame = function() { @@ -138,13 +111,11 @@ async function loadBatch() { if (scriptsToLoad.length) { const toLoad = scriptsToLoad.splice(0, scriptsToLoad.length); const results = await Promise.allSettled(toLoad.map(loadScript)); - for (let i=0; i