jkiss / ie7-js

Automatically exported from code.google.com/p/ie7-js
0 stars 1 forks source link

appversion detection fails on IE10 #390

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Load/execute script in IE 10
2.
3.

What is the expected output? What do you see instead?

Error: unable to get property of '1' of undefined or null reference

What version of the product are you using? On what operating system?

2.1(beta4) on Windows -- especially with Adobe Contribute which somehow ignores 
the IE comments to skip the script if over IE8 even though it's embedding IE10. 
Will probably not affect most users, but it was driving my clients using 
Contribute nuts ;-)

Please provide any additional information below.

The regular expression in the statement beginning line 6, col 84 supports only 
single-digit major version numbers. Adding a + character as shown in the 
following (and in the attached patched IE9.js) will support multi-digit major 
numbers as well as single.

var t=h.appVersion=navigator.appVersion.match(/MSIE (\d+\.\d)/)[1]-0;

Original issue reported on code.google.com by davidhbr...@gmail.com on 15 Aug 2013 at 3:42

Attachments:

GoogleCodeExporter commented 9 years ago
IE11 has changed the navigator.appVersion string, so the necessary regexp must 
include an alternation to find both the old "MSIE ##.#" and the new "rv:##.#" 
variations:

navigator.appVersion.match(/(?:MSIE |rv:)(\d+\.\d)/)[1]

Original comment by davidhbr...@gmail.com on 5 Dec 2013 at 2:50

Attachments: