Repository navigation
🐛 外部接入:隐身(split)进程不再连接 sctl,避免与普通进程每 2 秒互相顶替 - #1819
Merged
Merged
Conversation
split 模式下隐身进程与普通进程共用 chrome.storage.local 里的配对密钥和脚本, 两者都连 sctl daemon 时,daemon 只保留一条 ScriptCat 连接,被顶掉的一方 2 秒后重连 又顶掉另一方,日志和审计缓冲区被 handshake.ok 刷满(scriptscat/sctl#14)。 隐身进程不再启动连接,也不接受配对。
2 of 3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Checklist / 检查清单
背景
ScriptCat 的 manifest 设了
"incognito": "split",隐身窗口里会运行一个独立的扩展进程。它和普通进程共用chrome.storage.local中的配对密钥与脚本,所以两个进程都会用同一把密钥连接 sctl daemon。daemon 只保留一条 ScriptCat 连接,新连接顶替旧连接;ScriptCat 每次握手成功都把重连间隔重置为 2 秒,于是两个进程每 2 秒互相顶替,sctl 日志和审计缓冲区被handshake.ok刷满(scriptscat/sctl#14)。复现:真实 sctl daemon 加一个照抄
external-access-connect.ts重连策略的模拟客户端,单实例 12 秒内 1 次handshake.ok,两实例 7 次,每次间隔 2 秒,关闭原因replaced by new connection。本次改动
ExternalAccessController在隐身进程(chrome.extension.inIncognitoContext为真)中不再发起连接,也不接受接入(enroll)。普通进程代表这份安装连接 sctl;隐身进程看到的脚本与普通进程相同,不连接不会少任何能力。已知限制
关联
验证
基于
79f2a99f(main)…80ea2ea3,git diff origin/main...origin/fix/incognito-external-access只改external_access/controller.ts与其测试。pnpm vitest run --no-coverage src/app/service/service_worker/external_access/:8 个文件 141 个测试通过。tsc --noEmit、eslint、prettier 通过(提交时的 lint-staged 也跑过)。