Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit a84480a

Browse files
committedOct 7, 2014
refactor: use document.documentMode to determine msie version
Closes #9398
1 parent 6fd36de commit a84480a

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed
 

‎src/Angular.js

+3-6
Original file line numberDiff line numberDiff line change
@@ -173,13 +173,10 @@ var /** holds major version number for IE or NaN for real browsers */
173173
uid = 0;
174174

175175
/**
176-
* IE 11 changed the format of the UserAgent string.
177-
* See http://msdn.microsoft.com/en-us/library/ms537503.aspx
176+
* documentMode is an IE-only property
177+
* http://msdn.microsoft.com/en-us/library/ie/cc196988(v=vs.85).aspx
178178
*/
179-
msie = int((/msie (\d+)/.exec(lowercase(navigator.userAgent)) || [])[1]);
180-
if (isNaN(msie)) {
181-
msie = int((/trident\/.*; rv:(\d+)/.exec(lowercase(navigator.userAgent)) || [])[1]);
182-
}
179+
msie = document.documentMode;
183180

184181

185182
/**

‎src/ngScenario/browserTrigger.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
'use strict';
22

33
(function() {
4-
var msie = parseInt((/msie (\d+)/.exec(navigator.userAgent.toLowerCase()) || [])[1], 10);
4+
/**
5+
* documentMode is an IE-only property
6+
* http://msdn.microsoft.com/en-us/library/ie/cc196988(v=vs.85).aspx
7+
*/
8+
msie = document.documentMode;
59

610
/**
711
* Triggers a browser event. Attempts to choose the right event if one is

0 commit comments

Comments
 (0)