Skip to content
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(page): Page.goto should properly handle historyAPI in beforeunload #3198

Merged

Conversation

aslushnikov
Copy link
Contributor

Protocol's page.navigate doesn't report loaderId if the command resulted in a same-document
navigation. In this case we should anticipate same-document navigation and otherwise we should
wait for new document navigation.

Fixes #2764.

@@ -644,7 +649,11 @@ class Page extends EventEmitter {

const responses = new Map();
const listener = helper.addEventListener(this._networkManager, NetworkManager.Events.Response, response => responses.set(response.url(), response));
const error = await watcher.navigationPromise();
const error = await Promise.race([
watcher.timeoutPromise(),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why await the timeout promise here? Won't the same and new document navigations be called with the timeout?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, I split them out (see NavigationWatcher)

@aslushnikov aslushnikov merged commit d54c7ed into puppeteer:master Sep 5, 2018
@ntzm
Copy link
Contributor

ntzm commented Sep 6, 2018

It's me again :D Will this fix #2479?

@aslushnikov
Copy link
Contributor Author

@ntzm ah sorry, I still can repro this on tip-of-tree. Let me look into this; i forgot what was the root cause.

@ntzm
Copy link
Contributor

ntzm commented Sep 7, 2018

No worries, sorry to keep bothering you :D

@aslushnikov aslushnikov deleted the fix-historyapi-in-beforeunload branch November 2, 2018 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants