Created
July 1, 2019 05:51
-
-
Save ryochin/2292c94f4ec347ace4ab3e46ab067aee to your computer and use it in GitHub Desktop.
IE detection in TypeScript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as _ from 'lodash' | |
import * as Bowser from 'bowser' | |
isIE(): boolean { | |
const browser: Bowser.Parser.Parser = Bowser.getParser(window.navigator.userAgent) | |
const result: boolean | undefined = browser.satisfies({ | |
windows: { | |
'internet explorer': '>0' | |
} | |
}) | |
return _.isUndefined(result) ? false : result | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment