From ab7c7a9a60fa3e31a545dd66ea37bf8da34166af Mon Sep 17 00:00:00 2001 From: peshomir <80340328+peshomir@users.noreply.github.com> Date: Thu, 20 Mar 2025 13:30:29 +0200 Subject: [PATCH] Fix for update 2.06.2 --- build.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.js b/build.js index a408a14..97f2e1c 100644 --- a/build.js +++ b/build.js @@ -47,8 +47,8 @@ if (exposeVarsToGlobalScope && script.startsWith("(function () {") && script.end script = script.slice("(function () {".length, -"})();".length); // uncompress strings -// this will break if there is a closing square bracket ("]") in one of the strings -const stringArrayRaw = script.match(/var S=(\[[^\]]+\]);/)?.[1]; +// this will break if the sequence `"];` appears in one of the strings +const stringArrayRaw = script.match(/var S=(\[.+?"\]);/)?.[1]; if (stringArrayRaw === undefined) throw new Error("cannot find the string array"); const stringArray = JSON.parse(stringArrayRaw); script = script.replace(/\bS\[(\d+)\]/g, (_match, index) => `"${stringArray[index]}"`);