Repository navigation
Conversation
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.
AI assistance: This patch and its tests were prepared with Codex.
The notification initialization script currently queries permission from the initial
about:blankdocument. On WebKitGTK this can reach IPC with an opaque origin, as reported in #3562. A rejected startup query also becomes an unhandled promise rejection.Skip automatic priming on
about:blankdocuments, including URL fragments and queries, and run it normally when the initialization script is injected into the real document. Handle a failed automatic query while leaving the permission atdefault, so an explicit permission query or request can retry. Explicit request failures still reject to the caller. The existing Windows shortcut andabout:srcdocpriming are preserved.Adds a dependency-free Node regression suite for the actual generated injection script, plus
test:notification-initto run it. The suite replaces only the IPC transport and uses separate VM contexts for the documents; it does not reproduce native navigation or WebKitGTK's startup timing.Validation on macOS 27.0.1 arm64, Node 24.14.0, TypeScript 6.0.3, Rollup 4.64.12 and Rust 1.97.1:
node --test .scripts/tests/notification-init.test.js: original generated script 10 passed / 5 failed; candidate 15 passed / 0 failed with the same tests. Covers startup URLs, subsequent document initialization,about:srcdoc, all permission states, Windows, handled startup rejection, retry and explicit request rejection.-D warnings, all-targets/all-features tests (4 passed), doc tests (4 compile-only examples passed), Rust 1.90.0 MSRV check, and workspace Rust formatting passed.Related overlap: draft #3541 changes desktop permission initialization to always grant permission. This patch retains the current backend permission model and handles the startup document and rejection paths; those changes would need reconciling if #3541 proceeds.
Native acceptance still pending:
Fixes #3562.