You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 28, 2018. It is now read-only.
I'm using Turbolinks.visit in a part of an application and a Firefox 9 user reported that the button had no effect. Upon investigation I discovered this exception.
http://caniuse.com/#feat=history doesn't show Firefox 9 being able to use pushState, but it appears to be able in my tests of it.
/* * DOMParser HTML extension * 2012-02-02 * * By Eli Grey, http://eligrey.com * Public domain. * NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. *//*! @source https://gist.github.com/1129031 *//*global document, DOMParser*/(function(DOMParser){"use strict";varDOMParser_proto=DOMParser.prototype,real_parseFromString=DOMParser_proto.parseFromString;// Firefox/Opera/IE throw errors on unsupported types try{// WebKit returns null on unsupported types if((newDOMParser).parseFromString("","text/html")){// text/html parsing is natively supported return;}}catch(ex){}DOMParser_proto.parseFromString=function(markup,type){if(/^\s*text\/html\s*(?:;|$)/i.test(type)){vardoc=document.implementation.createHTMLDocument(""),doc_elt=doc.documentElement,first_elt;doc_elt.innerHTML=markup;first_elt=doc_elt.firstElementChild;if(doc_elt.childElementCount===1&&first_elt.localName.toLowerCase()==="html"){doc.replaceChild(first_elt,doc_elt);}returndoc;}else{returnreal_parseFromString.apply(this,arguments);}};}(DOMParser));
I'm happy to do a PR with this type of implementation if there aren't any better solutions.
The text was updated successfully, but these errors were encountered:
The other thought I have is that maybe visit() should be wrapped in a try/catch so that if anything fails we can still get the user on his or her way. This likely happens anyway for a normal link, but if you're calling Turbolinks.visit() within a script the user may end up clicking on something and getting no response.
https://github.com/rails/turbolinks/blob/master/lib/assets/javascripts/turbolinks.js.coffee#L156
Relates to #39
Throws a not implemented exception on Firefox 9.
I'm using Turbolinks.visit in a part of an application and a Firefox 9 user reported that the button had no effect. Upon investigation I discovered this exception.
http://caniuse.com/#feat=history doesn't show Firefox 9 being able to use pushState, but it appears to be able in my tests of it.
If you look at http://stackoverflow.com/questions/9250545/javascript-domparser-access-innerhtml-and-other-properties/9251106#9251106 there is a "fix" for this issue:
I'm happy to do a PR with this type of implementation if there aren't any better solutions.
The text was updated successfully, but these errors were encountered: