Skip to content

Commit

Permalink
feat(boxjs): /api/runScritp 接受 argument 参数
Browse files Browse the repository at this point in the history
  • Loading branch information
chavyleung committed Apr 21, 2024
1 parent fee0112 commit 252c5d5
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 2 deletions.
5 changes: 4 additions & 1 deletion box/chavy.boxjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const $ = new Env('BoxJs')
// 为 eval 准备的上下文环境
const $eval_env = {}

$.version = '0.18.1'
$.version = '0.19.0'
$.versionType = 'beta'

// 发出的请求需要需要 Surge、QuanX 的 rewrite
Expand Down Expand Up @@ -824,6 +824,9 @@ async function apiRunScript() {
} else {
script_text = opts.script
}
if (opts.argument) {
script_text = `globalThis.$argument="${opts.argument}";${script_text}`
}
if (
$.isSurge() &&
!$.isLoon() &&
Expand Down
19 changes: 19 additions & 0 deletions box/release/box.release.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
{
"releases": [
{
"version": "0.19.0",
"tags": ["beta"],
"author": "@chavyleung",
"msg": "feat(boxjs): /api/runScritp 接受 argument 参数",
"notes": [
{
"name": "功能",
"descs": [
"/api/runScritp 接受 argument 参数",
"作用: 非 Surge 用户可通过快捷方式请求 URL 的方式来执行切换会话"
]
},
{
"name": "感谢",
"descs": ["@is_bo 建议"]
}
]
},
{
"version": "0.18.1",
"tags": ["beta"],
Expand Down
19 changes: 19 additions & 0 deletions box/release/box.release.tf.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
{
"releases": [
{
"version": "0.19.0",
"tags": ["beta"],
"author": "@chavyleung",
"msg": "feat(boxjs): /api/runScritp 接受 argument 参数",
"notes": [
{
"name": "功能",
"descs": [
"/api/runScritp 接受 argument 参数",
"作用: 非 Surge 用户可通过快捷方式请求 URL 的方式来执行切换会话"
]
},
{
"name": "感谢",
"descs": ["@is_bo 建议"]
}
]
},
{
"version": "0.18.1",
"tags": ["beta"],
Expand Down
5 changes: 4 additions & 1 deletion chavy.box.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const $ = new Env('BoxJs')
// 为 eval 准备的上下文环境
const $eval_env = {}

$.version = '0.18.1'
$.version = '0.19.0'
$.versionType = 'beta'

// 发出的请求需要需要 Surge、QuanX 的 rewrite
Expand Down Expand Up @@ -824,6 +824,9 @@ async function apiRunScript() {
} else {
script_text = opts.script
}
if (opts.argument) {
script_text = `globalThis.$argument="${opts.argument}";${script_text}`
}
if (
$.isSurge() &&
!$.isLoon() &&
Expand Down

0 comments on commit 252c5d5

Please sign in to comment.