Skip to content

Instantly share code, notes, and snippets.

@AndreiHondrari
Created September 6, 2019 13:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AndreiHondrari/b5245716737b3924216e06c2e1210d22 to your computer and use it in GitHub Desktop.
Save AndreiHondrari/b5245716737b3924216e06c2e1210d22 to your computer and use it in GitHub Desktop.
function isIEBrowser() {
const userAgent = window.navigator.userAgent;
if (userAgent.includes("MSIE") || userAgent.includes("Trident"))
return true;
return false;
}
document.addEventListener('DOMContentLoaded', function(e) {
const isInternetExplorer = isIEBrowser();
if (isInternetExplorer) {
console.warn("Internet Explorer browser detected !");
// Do something about it...
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment