Skip to content

调整 EarlyStart 代码#816

Merged
CodFrm merged 2 commits intoscriptscat:mainfrom
cyfung1031:pr-code-for-earlystart
Oct 10, 2025
Merged

调整 EarlyStart 代码#816
CodFrm merged 2 commits intoscriptscat:mainfrom
cyfung1031:pr-code-for-earlystart

Conversation

@cyfung1031
Copy link
Copy Markdown
Collaborator

@cyfung1031
Copy link
Copy Markdown
Collaborator Author

      // 如果是EarlyScriptFlag,处理沙盒环境
      if (this.earlyScriptFlag.includes(flag)) {
        for (const val of this.execList) {
          if (val.scriptRes.flag === flag) {
            // 处理早期脚本的沙盒环境
            val.dealEarlyScript(this.envInfo!);
            break;
          }
        }
        return;
      }

checkEarlyStartScript总是先执行,应该不会跑这个

@cyfung1031 cyfung1031 force-pushed the pr-code-for-earlystart branch from b6c6670 to 2f7c0e1 Compare October 10, 2025 11:01
@CodFrm
Copy link
Copy Markdown
Member

CodFrm commented Oct 10, 2025

      // 如果是EarlyScriptFlag,处理沙盒环境
      if (this.earlyScriptFlag.includes(flag)) {
        for (const val of this.execList) {
          if (val.scriptRes.flag === flag) {
            // 处理早期脚本的沙盒环境
            val.dealEarlyScript(this.envInfo!);
            break;
          }
        }
        return;
      }

checkEarlyStartScript总是先执行,应该不会跑这个

确实如此,可以删除

不对,这里的目的是更新envInfo

Comment thread src/content.ts
Comment on lines +30 to +32
const loadEarlyScriptFlag = (flag: string[]) => {
scriptExecutor.checkEarlyStartScript(flag);
};
Copy link
Copy Markdown
Member

@CodFrm CodFrm Oct 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

只有一行,不需要封装吧,不过问题不大

@CodFrm CodFrm self-requested a review October 10, 2025 14:33
@CodFrm CodFrm merged commit 524c9ee into scriptscat:main Oct 10, 2025
2 of 3 checks passed
@cyfung1031 cyfung1031 deleted the pr-code-for-earlystart branch October 17, 2025 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants