-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ac22a7b
commit 3b60879
Showing
4 changed files
with
23 additions
and
5 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
export default function checkBrowser() { | ||
const ua = navigator.userAgent | ||
const chrome = ua.match(/Chrome\/(\d+)/) | ||
const firefox = ua.match(/Firefox\/(\d+)/) | ||
const edge = ua.match(/Edge\/(\d+)/) | ||
const safari = ua.match(/Safari\/(\d+)/) | ||
if ( | ||
(chrome && Number(chrome[1]) < 108) || | ||
(firefox && Number(firefox[1]) < 101) || | ||
(edge && Number(edge[1]) < 108) || | ||
(safari && Number(safari[1]) < 15.4) | ||
) { | ||
alert(` | ||
您的浏览器版本过低,可能无法正常使用本应用 | ||
建议使用最新版本的 Chrome / Edge / Firefox / Safari 浏览器 | ||
`) | ||
} | ||
} |
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
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