From eef4fa0751a2791dc6441ba1f58956292f857596 Mon Sep 17 00:00:00 2001 From: xream Date: Sat, 31 Aug 2024 18:47:02 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=84=9A=E6=9C=AC=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E4=BC=A0=E5=85=A5=E4=B8=8A=E4=B8=8B=E6=96=87=20`require`=20(?= =?UTF-8?q?=E4=BB=85=E5=AF=B9=E5=BA=94=E7=9A=84=E7=8E=AF=E5=A2=83=E6=94=AF?= =?UTF-8?q?=E6=8C=81)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/package.json | 2 +- backend/src/core/proxy-utils/processors/index.js | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/backend/package.json b/backend/package.json index 1e1b142..860548f 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "sub-store", - "version": "2.14.365", + "version": "2.14.366", "description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.", "main": "src/main.js", "scripts": { diff --git a/backend/src/core/proxy-utils/processors/index.js b/backend/src/core/proxy-utils/processors/index.js index 9c01526..e2a7564 100644 --- a/backend/src/core/proxy-utils/processors/index.js +++ b/backend/src/core/proxy-utils/processors/index.js @@ -987,6 +987,7 @@ function createDynamicFunction(name, script, $arguments) { 'scriptResourceCache', 'flowUtils', 'produceArtifact', + 'require', `${script}\n return ${name}`, )( $arguments, @@ -1002,6 +1003,7 @@ function createDynamicFunction(name, script, $arguments) { scriptResourceCache, flowUtils, produceArtifact, + require, ); } else { return new Function( @@ -1012,6 +1014,7 @@ function createDynamicFunction(name, script, $arguments) { 'scriptResourceCache', 'flowUtils', 'produceArtifact', + 'require', `${script}\n return ${name}`, )( @@ -1022,6 +1025,7 @@ function createDynamicFunction(name, script, $arguments) { scriptResourceCache, flowUtils, produceArtifact, + require, ); } }