Last active
March 6, 2021 00:01
-
-
Save mosesoak/084c634b33705dacd0cd9df9f06e1476 to your computer and use it in GitHub Desktop.
MSIE Blocker Script (vanilla)
This file contains 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
<head> | |
<script type="text/javascript"> | |
// Show a blocking message on MSIE | |
// (documentMode is an IE-only property, versions 8-11) | |
if (typeof window !== 'undefined' && window.document.documentMode) { | |
window.onload = function () { | |
document.body.innerHTML = | |
'Internet Explorer is no longer supported.<br /><br />Please visit this site on Edge or Chrome.'; | |
document.body.style.cssText = | |
'text-align: center; padding-top: 40vh; font-family: Sans-Serif;'; | |
}; | |
} | |
</script> | |
</head> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment