🐛 修复 Edge Dev 下脚本注入静默失效 - #1725
Open
mikemikimike wants to merge 1 commit into
Open
Conversation
1 task
cyfung1031
approved these changes
Sep 4, 2026
cyfung1031
left a comment
Collaborator
There was a problem hiding this comment.
@CodFrm looks good to me. please follow up.
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 / 检查清单
Background
On Edge Dev 154, user scripts can silently stop working because the registration guard only checks
scriptcat-inject. Whenscriptcat-scriptingis missing, the guard returns early and the broadcaster is not recreated. The isolated-world environment reader can also throw whenchrome.extensionis unavailable.Changes
scriptcat-scriptingcontent script together withscriptcat-injectbefore skipping registration.chrome.extension.inIncognitoContextdefensively and default tofalsewhen the API is unavailable.chrome.extensionAPI.Implementation considerations
The existing registration flow remains responsible for unregistering and recreating missing registrations. The additional content-script query is only used by the already-registered fast path, so valid registrations continue to avoid duplicate work.
Known limitations
The full CI test command completed with 4421 passed and 38 failures across 15 files. The failures are existing environment-, timing-, and Windows-path-sensitive failures; the changed test files passed. GitHub Actions for fork pull requests may require maintainer approval before jobs run.
Review focus
scriptcat-scriptingregistration check matches the broadcaster registration lifecycle.chrome.extensionaccess is compatible with all supported extension contexts.References
Issue 1724 reports the Edge Dev 154 regression and identifies both affected code paths.
Related
Refs #1724
Validation
node pnpm.cjs exec vitest run src/app/service/extension/extension_env.test.ts src/app/service/service_worker/runtime.test.ts— 58 passed.node pnpm.cjs run typecheck— passed.node pnpm.cjs run lint— passed.node pnpm.cjs run build— passed with existing asset-size and dynamic-require warnings.node pnpm.cjs run test:ci— 4421 passed, 38 existing environment/timing/path failures.Screenshots / 截图