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

Route when listen is called to create consistent behaviour for different browsers #32

Open
nikgraf opened this issue May 2, 2013 · 0 comments

Comments

@nikgraf
Copy link
Contributor

nikgraf commented May 2, 2013

A proposal to fix the issue of Browsers behave differently on page load. If you start listening with a router in Chrome this will fire a handler on page load. In Firefox it doesn't.

Browsers tend to handle the popstate event differently on page load. Chrome and Safari always emit a popstate event on page load, but Firefox doesn't. see https://developer.mozilla.org/en-US/docs/DOM/window.onpopstate

To create a consistent behavior I propose to copy the concept of Backbone's routing. Backbone routes by default when you starting the history. see https://github.com/documentcloud/backbone/blob/master/backbone.js#L1417
We also could implement a silent option to prevent routing on app start.

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

No branches or pull requests

1 participant