New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: emit will-navigate for links in chrome: pages #40390
Conversation
// ignore that. | ||
// https://source.chromium.org/chromium/chromium/src/+/main:content/browser/renderer_host/navigator.cc;l=883-892;drc=0c8ffbe78dc0ef2047849e45cefb3f621043e956 | ||
if (!is_renderer_initiated && | ||
ui::PageTransitionIsWebTriggerable(handle->GetPageTransition())) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(This was new to me, so tldr for other reviewers: true if it's a link, auto subframe, manual subframe, or form submission")
Co-authored-by: Charles Kerr <charles@charleskerr.com>
8db3107
to
2f1e6fd
Compare
Release Notes Persisted
|
I have automatically backported this PR to "27-x-y", please check out #40524 |
I have automatically backported this PR to "28-x-y", please check out #40525 |
* fix: emit will-navigate for links in chrome: pages * test: will-navigate emitted from chrome: pages * Update shell/browser/electron_navigation_throttle.cc Co-authored-by: Charles Kerr <charles@charleskerr.com> --------- Co-authored-by: Charles Kerr <charles@charleskerr.com>
Description of Change
Navigating to links within
chrome:
pages—such as chrome://gpu—don't emit the "will-navigate" event. This is caused by navigations in pages with Web UI (e.g.chrome:
pages) to always be set as browser-initiated requests.To fix this, we're overriding the browser-initiated flag for certain page transitions with navigations on Web UI pages. Pressing links is a link page transition while calling
loadURL
uses a different page transition type.Checklist
npm test
passesRelease Notes
Notes: Fixed "will-navigate" not being emitted when pressing links in
chrome:
pages.