From 21728acba0da990f1d665ef62db03987ba8775d5 Mon Sep 17 00:00:00 2001 From: cyfung1031 <44498510+cyfung1031@users.noreply.github.com> Date: Sat, 7 Feb 2026 20:36:43 +0900 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=20installScript=20=E4=B8=AD?= =?UTF-8?q?=20subscribeUrl=20origin=20=E5=85=B3=E8=BF=9E=E9=83=A8=E4=BB=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/service/service_worker/script.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/app/service/service_worker/script.ts b/src/app/service/service_worker/script.ts index 59873e093..a19f6e29c 100644 --- a/src/app/service/service_worker/script.ts +++ b/src/app/service/service_worker/script.ts @@ -395,6 +395,13 @@ export class ScriptService { // 执行更新逻辑 update = true; script.selfMetadata = oldScript.selfMetadata; + // 如果已安装的脚本是由 Subscribe 安装,即使是手动更新也不会影响跟 Subscribe 关联 + if (oldScript.subscribeUrl && oldScript.origin) { + // origin 和 subscribeUrl 保持不变 + // @downloadURL @updateURL 随脚本最新代码而更新 + script.origin = oldScript.origin; + script.subscribeUrl = oldScript.subscribeUrl; + } } if (script.ignoreVersion) script.ignoreVersion = ""; if (createtime) {