Merged
Conversation
6dc893b to
3fef55c
Compare
65490ec to
52a63ae
Compare
Member
|
主要是希望全随机,没有特征一些,这样可以反正识别前/后缀检测到脚本猫在运行,虽然这个担心好像看起来有点多余 |
Collaborator
Author
这个担心好像看起来有点多余 |
Collaborator
Author
这个 messageFlag 只是用来控制不会执行旧脚本代码 |
7a6bcd5 to
b01f9d3
Compare
Contributor
There was a problem hiding this comment.
Pull Request Overview
此 PR 简化了 messageFlag 的结构,将原本的多个动态标识符(contentFlag、injectFlag、scriptLoadComplete、envLoadComplete)整合为单一的随机 messageFlag,并将固定的后缀部分提取到 DefinedFlags 常量中。
- 将 MessageFlags 接口从 5 个属性简化为 1 个属性(仅保留
messageFlag) - 新增
runtime.consts.ts文件定义固定的标识后缀(.ct、.fd、.slc、.elc、.dom) - 统一事件命名模式为
evt{random}{flag}{suffix},其中{random}为随机部分,{flag}和{suffix}为固定常量
Reviewed Changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
src/types/main.d.ts |
简化 MessageFlags 接口,移除 4 个动态属性,仅保留 messageFlag |
src/app/service/service_worker/runtime.ts |
简化 messageFlags 初始化逻辑,并修正变量命名(loadingInitFlagPromise → loadingInitFlagsPromise) |
src/app/service/service_worker/runtime.consts.ts |
新增文件,定义固定的标识后缀常量(contentFlag、injectFlag、scriptLoadComplete、envLoadComplete、domEvent) |
src/app/service/content/utils.ts |
更新事件名构造逻辑,使用 DefinedFlags 常量代替动态标识 |
src/app/service/content/script_executor.ts |
更新事件名构造逻辑,与 utils.ts 保持一致 |
packages/message/server.test.ts |
更新测试以适配新的标识结构,改进事件类型检查逻辑 |
packages/message/custom_event_message.ts |
重构构造函数,使用 DefinedFlags 构建 receiveFlag 和 sendFlag,移除 sendEventName() 方法 |
cyfung1031
added a commit
to cyfung1031/scriptcat
that referenced
this pull request
Nov 15, 2025
cyfung1031
added a commit
to cyfung1031/scriptcat
that referenced
this pull request
Nov 17, 2025
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.
概述 Descriptions
一个随机,其他都是固定接头 / 接尾
变更内容 Changes
截图 Screenshots