From 66542d31309f20821425d89fe13efd57780b6922 Mon Sep 17 00:00:00 2001 From: ZXMushroom63 Date: Sat, 31 Aug 2024 18:07:56 +0800 Subject: [PATCH] remove data-mod, to save ram --- modloader.injector.js | 4 +--- modloader.js | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/modloader.injector.js b/modloader.injector.js index 3106c34..b99f9d5 100644 --- a/modloader.injector.js +++ b/modloader.injector.js @@ -91,7 +91,7 @@ window.modLoader = async function modLoader(modsArr = []) { console.log("[EaglerML] Searching in iDB"); try { var idbMods = await getMods(); - modsArr.concat(idbMods + modsArr = modsArr.concat(idbMods .filter(x => { return x && x.length > 0 }) .flatMap(x => { if (x.startsWith("web@")) { return x.replace("web@", "") } return x }) ); @@ -132,7 +132,6 @@ window.modLoader = async function modLoader(modsArr = []) { console.log("[EaglerML] Loading " + currentMod + " via method B."); var script = document.createElement("script"); script.src = currentMod; - script.setAttribute("data-mod", currentMod); script.setAttribute("data-isMod", true); script.onerror = () => { console.log( @@ -174,7 +173,6 @@ window.modLoader = async function modLoader(modsArr = []) { methodB(currentMod); return; } - script.setAttribute("data-mod", currentMod); script.setAttribute("data-isMod", true); script.onerror = () => { console.log( diff --git a/modloader.js b/modloader.js index e149676..e810b29 100644 --- a/modloader.js +++ b/modloader.js @@ -92,7 +92,7 @@ window.modLoader = async function modLoader(modsArr = []) { console.log("[EaglerML] Searching in iDB"); try { var idbMods = await getMods(); - modsArr.concat(idbMods + modsArr = modsArr.concat(idbMods .filter(x => { return x && x.length > 0 }) .flatMap(x => { if (x.startsWith("web@")) { return x.replace("web@", "") } return x }) ); @@ -133,7 +133,6 @@ window.modLoader = async function modLoader(modsArr = []) { console.log("[EaglerML] Loading " + currentMod + " via method B."); var script = document.createElement("script"); script.src = currentMod; - script.setAttribute("data-mod", currentMod); script.setAttribute("data-isMod", true); script.onerror = () => { console.log( @@ -175,7 +174,6 @@ window.modLoader = async function modLoader(modsArr = []) { methodB(currentMod); return; } - script.setAttribute("data-mod", currentMod); script.setAttribute("data-isMod", true); script.onerror = () => { console.log(