Browse files

Fix JX.History on Firefox

Fixes ##JX.History## for browsers that support the HTML5 History API but do not
pass the test:

  'onpopstate' in window

Test Plan:
1. Without the fix, open ##specs/historytest.html## in Firefox.
2. Verify that clicking to another page and pressing back fails to change the
3. With the fix, open ##specs/historytest.html## in Firefox.
4. Verifying that clicking to another page and pressing back correctly changes
the content.
5. Verify that other browsers still work.

Reviewers: epriestley, cpojer, aran

Reviewed By: aran

CC: aran

Differential Revision: 937
  • Loading branch information...
1 parent 5bdbc0c commit 7f8dec98f96b28c5bd0cd51d492e362574deb3c1 @yungsters yungsters committed Sep 15, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/lib/History.js
@@ -135,7 +135,7 @@ JX.install('History', {
initialize : function() {
- if ('onpopstate' in window) {
+ if (JX.History.hasPushState()) {
JX.History._initialPath = JX.History._getBasePath(location.href);
JX.Stratcom.listen('popstate', null, JX.History._handleChange);
} else if ('onhashchange' in window) {

0 comments on commit 7f8dec9

Please sign in to comment.