ded/bowser — pull request #20 by MartinodF (2013-06-27 17:47:20+00:00)
Title: Add IE11 support + avoid exception when unable to match UA

The user agent has changed considerably in IE11 and it no longer contains the "MSIE x.y" part which bowser detects. Microsoft has been using "Trident/x.0" in the user agent consistently since IE8 and that isn't changed with IE11. Also, the version number seems to be included near the end now, using the format "rv:x.y", just like Firefox has been doing since v5.0.

I changed the IE regex to match either MSIE or Trident (case-insensitively), and changed the version number regex to read the "x.y" number just after either "MSIE " or "rv:".

I know IE11 still isn't final and that its user agent might still change, but bowser right now raises an exception on load (when trying to read bowser.msie for graded browser support) and breaks every page it's included on. While that's due primarily to the fact that detect() returns undefined if no browser matches (which I also fixed in the first commit), I figured I could go ahead and add IE11 support too.

Thanks!