Fix for update 2.06.2

dev
peshomir 2025-03-20 13:30:29 +02:00
parent da3c5b0e15
commit ab7c7a9a60
1 changed files with 2 additions and 2 deletions

View File

@ -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]}"`);