Closed bcardarella closed 5 years ago
I've confirmed the strange bug on two different systems and have detailed the bug report here: https://bugzilla.mozilla.org/show_bug.cgi?id=593910
Any thoughts would be welcome.
Thanks for doing the legwork here. I ran into this a couple of times with FF, but also had problems recreating it. Let me know if the Mozilla guys have a workaround, otherwise we may have to use wrapper functions for the API instead :(
That's pretty much what I ended up doing. In the code to call history.replaceState I just have a conditional that tests for its existence then calls changeState instead:
if (typeof(history.replaceState) == 'undefined') {
changeState(obj, title, url);
} else {
history.replaceState(obj, title, url);
}
Hope that helps others.
Hey guys,
I think if you use
window.History.prototype.replaceState = function() {
//blah
}
it should solve the problem
Maybe you could use both? Use window.History.prototype.replaceState =
and then fall back to window.history.replaceState =
if that doesn't work.
I cannot isolate why but it seems that Firefox will randomly not define the state functions on the history object. I see no debug messages in the console nor any error messages.
Kind of a poor bug report, but it's happening and I can only recreate it randomly. I'll try to gather more info.