Repository navigation
fix: ensure history navigations are sandboxed-iframe-aware - #35420
Conversation
deepak1556
left a comment
There was a problem hiding this comment.
Thanks for working on this issue!
Electron had the override before for an older process architecture where Renderer process would always restart expect for history navigations. But we have since then aligned our process architecture to that of Chromium and this hack is not required.
|
Great, thank you for the reviews @deepak1556 and @codebytere! |
|
@jeremyspiegel Can you rebase this PR on latest |
ba36670 to
f7fa823
Compare
f7fa823 to
16705a7
Compare
16705a7 to
5395194
Compare
|
@zcbenz I've rebased on latest |
|
Release Notes Persisted
|
|
I have automatically backported this PR to "19-x-y", please check out #35621 |
|
I have automatically backported this PR to "20-x-y", please check out #35622 |
|
I have automatically backported this PR to "21-x-y", please check out #35623 |
Description of Change
This fixes #35391
When a sandboxed iframe calls
history.go(), the renderer calls into the browser at RenderFrameHostImpl::GoToEntryAtOffset:The call to
delegate_->IsAllowedToGoToEntryAtOffset(offset)goes to WebContentsImpl::IsAllowedToGoToEntryAtOffset:And Electron's implementation of
delegate_->OnGoToEntryOffset(offset)in electron::api::WebContents::OnGoToEntryOffset handles the navigation itself, rather than allowingRenderFrameHostImpl::GoToEntryAtOffset's default behavior of navigating in the frame instead of the parent context:This change removes the override of
OnGoToEntryOffsetinelectron::api::WebContents(the default implementation ofWebContentsDelegate::OnGoToEntryOffsetis justreturn true).The override was added by @deepak1556 in #3875 to fix #3734. I think that the calling Chrome code may have changed since then, since it was so long ago (2015) and because of the comment in
WebContentsImpl::IsAllowedToGoToEntryAtOffsetabout needing to renameWebContentsDelegate::OnGoToEntryOffsettoWebContentsDelegate::IsAllowedToGoToEntryAtOffset or ShouldGoToEntryAtOffset.Checklist
npm testpassesRelease Notes
Notes: Fixed issue with history.back() in sandboxed iframes affecting parent browsing context.