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

document.documentMode return undefined #11541

Open
ghost opened this issue Apr 10, 2015 · 2 comments
Open

document.documentMode return undefined #11541

ghost opened this issue Apr 10, 2015 · 2 comments

Comments

@ghost
Copy link

ghost commented Apr 10, 2015

Hi

I was testing a little around, and hard to come up with some tests for this, but in some cases document.documentMode are returned undefined when identifying IE.

Mostly I encountered this on ES6 transpillers where they don't have a window object directly. Example es6transpiller() where you have to add globals like / globals window, document / if you need access to window.

There are also several other scenarios this happen. Simply because the console (F12) are not open.

As a workaround I found this solution:

var jscriptVersion = window.ScriptEngineMajorVersion,
ie = jscriptVersion && jscriptVersion();

With this code it works in all scenarios.

@pkozlowski-opensource
Copy link
Member

@marcorra I'm confused how your write-up is related to AngularJS.... Closing as it doesn't sound like a bug report / feature request for AngularJS....

@ghost
Copy link
Author

ghost commented Apr 10, 2015

@pkozlowski-opensource If you are confused take a look at this source code line from inside AngularJS

https://github.com/angular/angular.js/blob/master/src/Angular.js#L189

Here you clearly see that AngularJS are using document.documentMode to identify IE.

This issue ticket was only to mention that this is will not identify IE in some use cases, as the intension is inside AngularJS.

Hope that was clear, and you are not confused now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants