Skip to content

Commit c6f370e

Browse files
committed
fix(boxjs): save false val; sync chavy.box.js; bump 0.19.26
- Use hasOwnProperty for save path so boolean false updates persist - Sync root chavy.box.js with box/chavy.boxjs.js - Record 0.19.26 in box.release.json and box.release.tf.json - Trim BoxJs subscription: drop archived apps and invalid yuexianhuo entry Made-with: Cursor
1 parent 477728a commit c6f370e

5 files changed

Lines changed: 30 additions & 93 deletions

File tree

box/chavy.boxjs.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const $ = new Env('BoxJs')
33
// 为 eval 准备的上下文环境
44
const $eval_env = {}
55

6-
$.version = '0.19.25'
6+
$.version = '0.19.26'
77
$.versionType = 'beta'
88

99
// 发出的请求需要需要 Surge、QuanX 的 rewrite
@@ -739,7 +739,8 @@ async function apiUpdate() {
739739
const path = data.path.split('.')
740740
const val = data.val
741741
const key = path.shift()
742-
if (data.val && path.join('.')) {
742+
// 必须用 hasOwnProperty:val 为 false 时 data.val && … 会误判为跳过更新
743+
if (path.join('.') && Object.prototype.hasOwnProperty.call(data, 'val')) {
743744
switch (key) {
744745
case 'usercfgs':
745746
const usercfgs = getUserCfgs()

box/chavy.boxjs.json

Lines changed: 0 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -66,37 +66,6 @@
6666
"https://raw.githubusercontent.com/Orz-3/mini/master/Color/10010.png"
6767
]
6868
},
69-
{
70-
"id": "chavyleung.10086",
71-
"name": "10086",
72-
"keys": [
73-
"chavy_autologin_cmcc",
74-
"chavy_getfee_cmcc",
75-
"chavy_tokenurl_10086",
76-
"chavy_tokenheader_10086",
77-
"chavy_signurl_10086",
78-
"chavy_signheader_10086"
79-
],
80-
"author": "@wangfei021325, @chavyleung",
81-
"repo": "https://github.com/chavyleung/scripts/blob/master/10086/10086.js",
82-
"script": "https://raw.githubusercontent.com/chavyleung/scripts/master/10086/10086.js",
83-
"icons": [
84-
"https://raw.githubusercontent.com/Orz-3/mini/master/Alpha/10086.png",
85-
"https://raw.githubusercontent.com/Orz-3/mini/master/Color/10086.png"
86-
]
87-
},
88-
{
89-
"id": "bcz",
90-
"name": "百词斩",
91-
"keys": ["senku_cookie_bcz", "senku_key_bcz"],
92-
"author": "@gideonsenku",
93-
"repo": "https://github.com/chavyleung/scripts/tree/master/bcz",
94-
"script": "https://raw.githubusercontent.com/chavyleung/scripts/master/bcz/bcz.js",
95-
"icons": [
96-
"https://raw.githubusercontent.com/Orz-3/mini/master/Alpha/bcz.png",
97-
"https://raw.githubusercontent.com/Orz-3/mini/master/Color/bcz.png"
98-
]
99-
},
10069
{
10170
"id": "BAIDU",
10271
"name": "百度签到",
@@ -151,22 +120,6 @@
151120
"https://raw.githubusercontent.com/58xinian/icon/master/pagoda.png"
152121
]
153122
},
154-
{
155-
"id": "dbsj",
156-
"name": "豆瓣时间",
157-
"keys": [
158-
"senku_signurl_dbsj",
159-
"senku_signheader_dbsj",
160-
"senku_signbody_dbsj"
161-
],
162-
"author": "@gideonsenku",
163-
"repo": "https://github.com/chavyleung/scripts/tree/master/dbsj",
164-
"script": "https://raw.githubusercontent.com/chavyleung/scripts/master/dbsj/dbsj.js",
165-
"icons": [
166-
"https://raw.githubusercontent.com/Orz-3/mini/master/Alpha/dbsj.png",
167-
"https://raw.githubusercontent.com/Orz-3/mini/master/Color/dbsj.png"
168-
]
169-
},
170123
{
171124
"id": "fandeng",
172125
"name": "樊登读书",
@@ -183,24 +136,6 @@
183136
"https://raw.githubusercontent.com/Orz-3/mini/master/Color/fandeng.png"
184137
]
185138
},
186-
{
187-
"id": "fenqile",
188-
"name": "分期乐",
189-
"keys": [
190-
"senku_signurl_fenqile",
191-
"senku_signheader_fenqile",
192-
"senku_signbody_fenqile",
193-
"senku_signDailyKey_fenqile",
194-
"senku_signDailyUrlKey_fenqile"
195-
],
196-
"author": "@gideonsenku",
197-
"repo": "https://github.com/chavyleung/scripts/tree/master/fenqile",
198-
"script": "https://raw.githubusercontent.com/chavyleung/scripts/master/fenqile/fenqile.js",
199-
"icons": [
200-
"https://raw.githubusercontent.com/Orz-3/mini/master/Alpha/fenqile.png",
201-
"https://raw.githubusercontent.com/Orz-3/mini/master/Color/fenqile.png"
202-
]
203-
},
204139
{
205140
"id": "gdoil",
206141
"name": "加油广东",
@@ -533,18 +468,6 @@
533468
"https://raw.githubusercontent.com/Orz-3/mini/master/Color/zxhc.png"
534469
]
535470
},
536-
{
537-
"id": "zimuzu",
538-
"name": "字幕组",
539-
"keys": ["chavy_cookie_zimuzu", "chavy_auth_url_zimuzu_app"],
540-
"author": "@chavyleung",
541-
"repo": "https://github.com/chavyleung/scripts/tree/master/zimuzu",
542-
"script": "https://raw.githubusercontent.com/chavyleung/scripts/master/zimuzu/zimuzu.js",
543-
"icons": [
544-
"https://raw.githubusercontent.com/Orz-3/mini/master/Alpha/zimuzu.png",
545-
"https://raw.githubusercontent.com/Orz-3/mini/master/Color/zimuzu.png"
546-
]
547-
},
548471
{
549472
"id": "AcFun",
550473
"name": "AcFun",
@@ -636,18 +559,6 @@
636559
],
637560
"script": "https://raw.githubusercontent.com/chavyleung/scripts/master/ximalaya/ximalaya.js"
638561
},
639-
{
640-
"id": "rrtv",
641-
"name": "人人视频 [archived]",
642-
"keys": ["chavy_cookie_rrtv"],
643-
"author": "@chavyleung",
644-
"repo": "https://github.com/chavyleung/scripts/tree/master/achived/rrtv",
645-
"icons": [
646-
"https://raw.githubusercontent.com/Orz-3/mini/master/Alpha/rrtv.png",
647-
"https://raw.githubusercontent.com/Orz-3/mini/master/Color/rrtv.png"
648-
],
649-
"script": "https://raw.githubusercontent.com/chavyleung/scripts/master/achived/rrtv/rrtv.js"
650-
},
651562
{
652563
"id": "everphoto",
653564
"name": "时光相册",

box/release/box.release.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
{
22
"releases": [
3+
{
4+
"version": "0.19.26",
5+
"tags": ["beta"],
6+
"author": "@GideonSenku",
7+
"msg": "fix(boxjs): 保存设置时 val 为 false 仍应写入",
8+
"notes": [
9+
{
10+
"name": "修复",
11+
"descs": ["保存路径数据时用 hasOwnProperty 判断 val,避免 false 被当作未传值而跳过更新"]
12+
}
13+
]
14+
},
315
{
416
"version": "0.19.25",
517
"tags": ["beta"],

box/release/box.release.tf.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
{
22
"releases": [
3+
{
4+
"version": "0.19.26",
5+
"tags": ["beta"],
6+
"author": "@GideonSenku",
7+
"msg": "fix(boxjs): 保存设置时 val 为 false 仍应写入",
8+
"notes": [
9+
{
10+
"name": "修复",
11+
"descs": ["保存路径数据时用 hasOwnProperty 判断 val,避免 false 被当作未传值而跳过更新"]
12+
}
13+
]
14+
},
315
{
416
"version": "0.19.25",
517
"tags": ["beta"],

chavy.box.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const $ = new Env('BoxJs')
33
// 为 eval 准备的上下文环境
44
const $eval_env = {}
55

6-
$.version = '0.19.21'
6+
$.version = '0.19.26'
77
$.versionType = 'beta'
88

99
// 发出的请求需要需要 Surge、QuanX 的 rewrite
@@ -739,7 +739,8 @@ async function apiUpdate() {
739739
const path = data.path.split('.')
740740
const val = data.val
741741
const key = path.shift()
742-
if (data.val && path.join('.')) {
742+
// 必须用 hasOwnProperty:val 为 false 时 data.val && … 会误判为跳过更新
743+
if (path.join('.') && Object.prototype.hasOwnProperty.call(data, 'val')) {
743744
switch (key) {
744745
case 'usercfgs':
745746
const usercfgs = getUserCfgs()

0 commit comments

Comments
 (0)