diff options
| author | Chirayu Krishnappa | 2013-08-26 17:26:08 -0700 | 
|---|---|---|
| committer | Chirayu Krishnappa | 2013-08-29 16:07:49 -0700 | 
| commit | 427ee93f11d0ef64b8844f9b43b2a0f21f2be2cb (patch) | |
| tree | cad19245850549d9ce765164a8f114a443e16cba /src | |
| parent | 366c0e084b16c51dc1d1e5a47ac71d2770fdcc40 (diff) | |
| download | angular.js-427ee93f11d0ef64b8844f9b43b2a0f21f2be2cb.tar.bz2 | |
fix(core): parse IE11 UA string correctly
It's great that IE11 wants to be compatible enough that it doesn't want
to be special cased and treated differently.
However, as long as one has to have a different code path for IE than
for the other supported browsers, we still need to detect and special
case it.  For instance, our URL parsing code still needs the same
workaround the we used for IE10.  We still see the same Access denied /
TypeError exceptions when setting certain values.  FYI, Angular doesn't
generally blindly test for IE – we also check the version number.
Thanks to modern.ie for the free IE11 test VM.
Closes #3682
Diffstat (limited to 'src')
| -rw-r--r-- | src/Angular.js | 12 | ||||
| -rw-r--r-- | src/ng/urlUtils.js | 2 | 
2 files changed, 12 insertions, 2 deletions
| diff --git a/src/Angular.js b/src/Angular.js index 90c7234a..9e2f93f2 100644 --- a/src/Angular.js +++ b/src/Angular.js @@ -58,7 +58,7 @@ if ('i' !== 'I'.toLowerCase()) {  var /** holds major version number for IE or NaN for real browsers */ -    msie              = int((/msie (\d+)/.exec(lowercase(navigator.userAgent)) || [])[1]), +    msie,      jqLite,           // delay binding since jQuery could be loaded after us.      jQuery,           // delay binding      slice             = [].slice, @@ -75,6 +75,16 @@ var /** holds major version number for IE or NaN for real browsers */      uid               = ['0', '0', '0'];  /** + * IE 11 changed the format of the UserAgent string. + * See http://msdn.microsoft.com/en-us/library/ms537503.aspx + */ +msie = int((/msie (\d+)/.exec(lowercase(navigator.userAgent)) || [])[1]); +if (isNaN(msie)) { +  msie = int((/trident\/.*; rv:(\d+)/.exec(lowercase(navigator.userAgent)) || [])[1]); +} + + +/**   * @private   * @param {*} obj   * @return {boolean} Returns true if `obj` is an array or array-like object (NodeList, Arguments, ...) diff --git a/src/ng/urlUtils.js b/src/ng/urlUtils.js index c747ad9a..f1e31d7a 100644 --- a/src/ng/urlUtils.js +++ b/src/ng/urlUtils.js @@ -75,7 +75,7 @@ function $$UrlUtilsProvider() {       */      function resolve(url, parse) {        var href = url; -      if (msie) { +      if (msie <= 11) {          // Normalize before parse.  Refer Implementation Notes on why this is          // done in two steps on IE.          urlParsingNode.setAttribute("href", href); | 
