Skip to content

Instantly share code, notes, and snippets.

@andrejsharapov
Last active March 18, 2021 12:54
Show Gist options
  • Save andrejsharapov/d195ff1d9772146b8781bf51c1d49719 to your computer and use it in GitHub Desktop.
Save andrejsharapov/d195ff1d9772146b8781bf51c1d49719 to your computer and use it in GitHub Desktop.
if IE - [FOR NUXT] - redirects to info page
module.exports = {
head: {
meta: [
],
link: [
],
script: [
{
type: 'text/javascript',
src: '/ie-not-supported.js',
},
],
},
},
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<h1>IE NOT SUPPORTED</h1>
</body>
</html>
const MSIE = /Trident\/|MSIE/.test(window.navigator.userAgent);
// return alert('123');
function ieFound() {
if (MSIE === true) {
// return alert('456');
return (window.location =
'https://hostname/ie-not-supported.html');
}
}
ieFound();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment