Skip to content
This repository has been archived by the owner on Sep 25, 2021. It is now read-only.

Why does the before-visit event not get called when navigating via history? #216

Closed
joelmoss opened this issue Dec 6, 2016 · 4 comments
Closed

Comments

@joelmoss
Copy link

joelmoss commented Dec 6, 2016

This is driving me mad, and I can't understand why this would be the case. Is it a technical limitation, or a design decision?

@sstephenson
Copy link
Contributor

It's a technical limitation. The purpose of the before-visit event is to give your app a hook for canceling application visits before they begin. In the case of history navigation, the user has already clicked the Back button and the URL has changed. There's no way to cancel that.

@joelmoss
Copy link
Author

joelmoss commented Dec 6, 2016

The problem is that I can usually get around that using the beforeunload event, but that won;'t work with TL . Oh well :( thx anyway

@sstephenson
Copy link
Contributor

See #146 for an alternative to the beforeunload event.

@joelmoss
Copy link
Author

joelmoss commented Dec 6, 2016

Yeah I've seen that, but I want to be able to cancel the event (navigating) based on some behaviour

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants