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: promise resolved to early when browser initiated in-page navigation #39260
fix: promise resolved to early when browser initiated in-page navigation #39260
Conversation
@nornagon can you review this fix/change ? Thanks. |
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.
Can you fix the lint warnings?
/home/builduser/project/src/electron/lib/browser/api/web-contents.ts
450:9 error Identifier 'browser_intendent_in_page_navigation' is not in camel case camelcase
465:9 error Identifier 'browser_intendent_in_page_navigation' is not in camel case camelcase
481:12 error Identifier 'browser_intendent_in_page_navigation' is not in camel case camelcase
/home/builduser/project/src/electron/spec/api-web-contents-spec.ts
380:51 error Missing space before function parentheses space-before-function-paren
381:1 error Expected indentation of 8 spaces but found 10 indent
The code looks good to me.
Warnings fixed. |
@TomaszMa can you clarify what is meant by "browser intendent navigation"? I'm not sure I understand what that term refers to and haven't seen it before. |
browser intendent navigation - navigation triggered by browser, e.g.: loading resources like images . Navigation indirectly caused by user. Some of the browser intendent navigation can trigger 'did-navigate-in-page' event, e.g.: user intendent navigation - navigation triggered by user, e.g.: Problem is that when we call |
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.
@TomaszMa ok thanks. I was asking mostly because "intendent" isn't really a term that's used. We should something that more clearly conveys what's going on - browserInitiated
and userInitiated
are clearer. Let's instead say browserInitiatedInPageNavigation
and finishListenerWhenUserIntendentNavigation
.
@codebytere changed :) |
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.
thanks :D
Release Notes Persisted
|
Congrats on merging your first pull request! 🎉🎉🎉 |
I have automatically backported this PR to "24-x-y", please check out #39432 |
I have automatically backported this PR to "26-x-y", please check out #39433 |
I have automatically backported this PR to "25-x-y", please check out #39434 |
I think we should revert this - it's causing consistent failures on Linux cc @zcbenz |
Test during integration passed, so or added test on linux is unstable, or something else break the test. |
Description of Change
After this fix #36129 promise returned by
loadURL
function can be resolved before page finish loading. While page is loading it can trigger browser intendent in page navigation (e.g.:window.history.replaceState
). This PR fixes this problem.Checklist
npm test
passesRelease Notes
Notes: Fix problem with promise resolved to early when browser intendent in-page navigation