Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "feat: 脚本操作传入上下文 require (仅对应的环境支持)"
Browse files Browse the repository at this point in the history
xream committed Aug 31, 2024
1 parent ea7a3d7 commit e61baf6
Showing 3 changed files with 1 addition and 7 deletions.
2 changes: 1 addition & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sub-store",
"version": "2.14.366",
"version": "2.14.367",
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.",
"main": "src/main.js",
"scripts": {
4 changes: 0 additions & 4 deletions backend/src/core/proxy-utils/processors/index.js
Original file line number Diff line number Diff line change
@@ -987,7 +987,6 @@ function createDynamicFunction(name, script, $arguments) {
'scriptResourceCache',
'flowUtils',
'produceArtifact',
'require',
`${script}\n return ${name}`,
)(
$arguments,
@@ -1003,7 +1002,6 @@ function createDynamicFunction(name, script, $arguments) {
scriptResourceCache,
flowUtils,
produceArtifact,
require,
);
} else {
return new Function(
@@ -1014,7 +1012,6 @@ function createDynamicFunction(name, script, $arguments) {
'scriptResourceCache',
'flowUtils',
'produceArtifact',
'require',

`${script}\n return ${name}`,
)(
@@ -1025,7 +1022,6 @@ function createDynamicFunction(name, script, $arguments) {
scriptResourceCache,
flowUtils,
produceArtifact,
require,
);
}
}
2 changes: 0 additions & 2 deletions scripts/demo.js
Original file line number Diff line number Diff line change
@@ -3,8 +3,6 @@ function operator(proxies = [], targetPlatform, context) {
// 可参考 https://t.me/zhetengsha/970
// https://t.me/zhetengsha/1009

// require 为 Node.js 的 require, 在 Node.js 运行环境下 可以用来引入模块

// proxies 为传入的内部节点数组
// 可在预览界面点击节点查看 JSON 结构 或查看 `target=JSON` 的通用订阅
// 0. 结构大致参考了 Clash.Meta(mihomo), 可参考 mihomo 的文档, 例如 `xudp`, `smux` 都可以自己设置. 但是有私货, 下面是我能想起来的一些私货

0 comments on commit e61baf6

Please sign in to comment.