Skip to content

Instantly share code, notes, and snippets.

@wiseoldman
Created October 22, 2018 14:38
Show Gist options
  • Save wiseoldman/084b8552a1181b49981a7ba36f3e211c to your computer and use it in GitHub Desktop.
Save wiseoldman/084b8552a1181b49981a7ba36f3e211c to your computer and use it in GitHub Desktop.
[Internet Explorer check] Check if the browser is Internet Explorer #ie #fallback
function is_ie() {
const UA = window.navigator.userAgent;
const MS_IE = UA.indexOf("MSIE ");
if (MS_IE > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) {
return true;
}
return false;
}
module.exports = { is_ie };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment