This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
document.documentMode return undefined #11541
Open

Description
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.