From 92405dcf669e7272cae38efb746a1a4898cb862f Mon Sep 17 00:00:00 2001 From: XXhaos Date: Thu, 30 Apr 2026 12:51:45 +0900 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=96=87=E4=BB=B6=E8=87=B3?= =?UTF-8?q?=E3=80=8CScripts=E3=80=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Scripts/nodeseek.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Scripts/nodeseek.js b/Scripts/nodeseek.js index 3836e7a..d5afb2f 100644 --- a/Scripts/nodeseek.js +++ b/Scripts/nodeseek.js @@ -382,7 +382,13 @@ function ObjectKeys2LowerCase(obj) { /* ====================== 入口 ====================== */ !(async () => { try { - if (typeof $request !== "undefined") { + // 判断运行模式: + // - http-response 脚本:$response 存在(含 body)→ 抓 cookie + // - cron / 手动执行 / Node.js:$response 不存在 → 签到 + // 不能用 $request 判断,因为某些 Surge 版本在 cron 里也会注入 $request + const isMitmMode = + typeof $response !== "undefined" && $response && $response.body; + if (isMitmMode) { await getCookie(); } else { await checkEnv();