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 the errors in the case that e.g. an external code calls .pushState without path. #558

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

akeyhero
Copy link

@akeyhero akeyhero commented Mar 23, 2020

Hi.

I think we should inspect that e.state.path is not null nor undefined
because anyone can call .pushState with an arbitrary state argument.
https://developer.mozilla.org/en-US/docs/Web/API/PopStateEvent

I actually encountered this problem when I use an out-of-control external js code, which calls .pushState.

This should fix #293 .

This inspection of e.state.path is needed
because anyone can call .pushState with an arbitrary state argument.
@coveralls
Copy link

coveralls commented Mar 23, 2020

Coverage Status

Coverage remained the same at 92.562% when pulling 6bba5c2 on akeyhero:fix-errors-due-to-no-path into 94138d1 on visionmedia:master.

@akeyhero akeyhero changed the title Fix errors thrown when e.g. an external code calls .pushState without path. Fix the errors in the case that e.g. an external code calls .pushState without path. Mar 23, 2020
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.

Change history state during navigation, break page.js
2 participants