fix: attribute window.open downloads to opener page - #203
Open
alectimison-maker wants to merge 1 commit into
Open
fix: attribute window.open downloads to opener page#203alectimison-maker wants to merge 1 commit into
alectimison-maker wants to merge 1 commit into
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.
What
window.open(url)target withBrowser.downloadWillBeginand annotate the download with its openerCloses #194.
Why
Chromium reports a
window.open()navigation that becomes a download with a new target ID, then uses that ID asBrowser.downloadWillBegin.frameId. Because the target never becomes a page, its frame is absent from the opener's frame tree and Rustwright rejects the download payload untilexpect_download()times out.The core now tracks only direct-opener page targets that still have an empty URL. It stops treating them as transient after navigation or destruction, so downloads from an established popup are not reassigned to the opener. Python only performs the final target-identity check.
Testing
cargo fmt --all -- --checkcargo check --lockedcargo test --lib --locked(129 passed)maturin develop --releaseHeavyweight Docker and full-pytest verification were left to the repository's Blacksmith CI, per
AGENTS.md.Checklist