Skip to content

Commit

Permalink
refactor: extract detect-ie.js
Browse files Browse the repository at this point in the history
  • Loading branch information
pany-ang committed Nov 4, 2024
1 parent 8523ec6 commit bc0c8f4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
8 changes: 1 addition & 7 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,12 @@
<link rel="icon" href="/favicon.ico" />
<link rel="stylesheet" href="/app-loading.css" />
<title>%VITE_APP_TITLE%</title>
<script src="/detect-ie.js" defer></script>
</head>
<body>
<div id="app">
<div id="app-loading"></div>
</div>
<script>
// Tip: Simple judgments may not fully cover
if (/MSIE\s|Trident\//.test(window.navigator.userAgent)) {
document.body.innerHTML =
"<strong>Sorry, this browser is currently not supported. We recommend using the latest version of a modern browser. For example, Chrome/Firefox/Edge.</strong>"
}
</script>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
5 changes: 5 additions & 0 deletions public/detect-ie.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Tip: Simple judgments may not fully cover
if (/MSIE\s|Trident\//.test(window.navigator.userAgent)) {
document.body.innerHTML =
"<strong>Sorry, this browser is currently not supported. We recommend using the latest version of a modern browser. For example, Chrome/Firefox/Edge.</strong>"
}

0 comments on commit bc0c8f4

Please sign in to comment.