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

TypeError window.history.replaceState within Chrome Packaged App #8142

Closed
davidhooey opened this Issue Jun 1, 2015 · 4 comments

Comments

Projects
None yet
6 participants
@davidhooey

davidhooey commented Jun 1, 2015

Chrome Packaged Apps prevent the history API as mentioned here:

https://codereview.chromium.org/11196055

This causes an exception within jQuery Mobile like the following:

Error in response to storage.get: TypeError: window.history.replaceState is not a function
    at $.extend.squash (chrome-extension://lgdfkbpaenbbcabjamhbigiognieekhd/js/lib/jquery.mobile-1.4.4.js:2932:19)
    at $.extend.go (chrome-extension://lgdfkbpaenbbcabjamhbigiognieekhd/js/lib/jquery.mobile-1.4.4.js:3015:10)
    at Object.$.mobile.navigate (chrome-extension://lgdfkbpaenbbcabjamhbigiognieekhd/js/lib/jquery.mobile-1.4.4.js:3183:31)
    at $.widget.transition (chrome-extension://lgdfkbpaenbbcabjamhbigiognieekhd/js/lib/jquery.mobile-1.4.4.js:5644:15)
    at null.transition (chrome-extension://lgdfkbpaenbbcabjamhbigiognieekhd/js/lib/jquery.mobile-1.4.4.js:927:25)
    at null.<anonymous> (chrome-extension://lgdfkbpaenbbcabjamhbigiognieekhd/js/lib/jquery.mobile-1.4.4.js:5357:10)
    at Object.x.isFunction.i (chrome-extension://lgdfkbpaenbbcabjamhbigiognieekhd/js/lib/jquery-1.10.2.min.js:4:6426)
    at c (chrome-extension://lgdfkbpaenbbcabjamhbigiognieekhd/js/lib/jquery-1.10.2.min.js:4:26036)
    at Object.p.add [as done] (chrome-extension://lgdfkbpaenbbcabjamhbigiognieekhd/js/lib/jquery-1.10.2.min.js:4:26346)
    at $.widget._loadUrl (chrome-extension://lgdfkbpaenbbcabjamhbigiognieekhd/js/lib/jquery.mobile-1.4.4.js:5350:22)

Changing line jquery.mobile-1.4.4.js:2932 to first check for the presence of the function seems to solve the problem.

if(window.history.replaceState) {
    window.history.replaceState( state, state.title || document.title, href );
}

Even with the workaround a Chrome Packaged Apps continues to console.log the fact that history.replaceState is not available.

history.replaceState is not available in packaged apps.

Setting options mentioned in #5465 does not help. Seems as though a different way is needed to disable history.

Google Chrome: Version 43.0.2357.81 (64-bit) (Mac 10.10 & Windows 2008)
jQuery Mobile: 1.4.4

@samucs

This comment has been minimized.

Show comment
Hide comment
@samucs

samucs Jun 19, 2015

Hi, I have the same problem. Can't make it work with jQuery Mobile 1.4.5. Has anyone solved this issue?

samucs commented Jun 19, 2015

Hi, I have the same problem. Can't make it work with jQuery Mobile 1.4.5. Has anyone solved this issue?

@arschmitz arschmitz modified the milestones: 1.4.5, 1.5.0 Jun 19, 2015

@arschmitz

This comment has been minimized.

Show comment
Hide comment
@arschmitz

arschmitz Jun 19, 2015

Member

Thank you for reporting this we will look into making sure this is fixed for the upcoming 1.5 release

Member

arschmitz commented Jun 19, 2015

Thank you for reporting this we will look into making sure this is fixed for the upcoming 1.5 release

@laminko

This comment has been minimized.

Show comment
Hide comment
@laminko

laminko Sep 14, 2015

same problem, too. chromium 44.0.2403.89 (64 bit). jquerymobile 1.4.3.
thanks.

laminko commented Sep 14, 2015

same problem, too. chromium 44.0.2403.89 (64 bit). jquerymobile 1.4.3.
thanks.

@dt1973

This comment has been minimized.

Show comment
Hide comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment