add try/catch around do_user_agent_identification(); [was: Should stop relying on navigator.appVersion]
Created by: berdario
From MDN
Deprecated This feature has been removed from the Web standards. Though some browsers may still support it, it is in the process of being dropped. Do not use it in old or new projects. Pages or Web apps using it may break at any time.
And indeed this is starting to cause problems on my Firefox 37, Ubuntu. I have the following navigator.appVersion
:
"5.0 (X11)"
For comparison, on Chrome it's:
"5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.118 Safari/537.36"
This causes a TypeError: navigator.appVersion.match(...) is null
I assume at this line: (navigator.appVersion.match(/WebKit\/(\d+)\./)) [1]
(unfortunately the sample uses the minified mathjax, and thus it's not so simple to discover where it's failing)