DamonOehlman / detect-browser

Unpack a browser type and version from the useragent string

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Internet explorer versions < 11 not detected in compatibility mode

Neograph734 opened this issue · comments

This issue occured in Internet explorer 11 running in compatibility mode, emulating IE8-10. During that emulation the browser name and version were undefined.

Root of this cause is that navigator.userAgent contains the part 'Trident 7' (but not Gecko), so it does not fit any of the patterns.

Solution:
Update line 6 to [ 'ie', /MSIE\s([0-9\.]+);.*Trident\/[4-7].0/ ],

Thanks - I'll make that change in the next couple of days - unless you beat me to it with a PR :)

Created a request in #3 .