Repository navigation
fix(browser): a same-document back/forward returns at its commit while extensions run, too - #762
Merged
Merged
Conversation
…e extensions run, too With extensions active the engine keeps Page.* to itself, so #742's Page.navigatedWithinDocument never reaches the app and the wait ran to the 1.2 s grace. The page's main execution context answers instead: a same-document entry keeps it, a new document destroys it. Once the address moved, that context is asked for location.href; the new address from it is the commit. At most 6 asks; anything else ends at the grace as before.
|
PR test build retired — merged into |
Member
Author
|
Measured on this PR's CI build (exe 576daa66…, published engine 156.0.26-10, hidden desktop), 10 runs each: with uBlock Origin Lite + a cross-origin frame, back over an anchor entry 23 ms median (was 1,215), over a pushState entry 25 ms (was 1,217); without extensions 20 / 18 ms. 0/100 wrong page, next command ok 100/100. bfcache / no-store 25-29 ms; no entry still at the grace (1,271-1,297 ms). |
This was referenced Nov 23, 2026
Merged
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
Follow-up to #742. A same-document
browser.back/browser.forward(apushStateentry or an anchor) now returns at its commit while extensions run, too: it still waited the full 1.2 s grace there.With extensions active the engine keeps
Page.*events to itself (cdp_ledger, #274), so the main frame'sPage.navigatedWithinDocumentthat #742 waits for never reaches the app. The page's own main execution context answers instead: a same-document entry keeps it, a new document destroys it. Once the tab's address moved, the app asks that context (pinned by its id, asbrowser.evaluatedoes) forlocation.href; the new address from it counts as the entry's commit. At most 6 asks per back/forward; a gone context, a throw or a different spelling of the address fall back to the grace as before.Files: new
rpc/exec/same_doc.rs;rpc/exec/nav.rsholds the probe in the wait;read.rssharessend_eval_cdp;settle.rscomment only. No engine input.Measured before this change (#742's CI build, hidden desktop, published engine 156.0.26-10)
pushStateentryChecked
cargo check -p opencode-desktoponblade(exit 0).Not proved in this PR