-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from EOEFANS/main
feature: 三端检测
- Loading branch information
Showing
4 changed files
with
45 additions
and
10 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
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,17 @@ | ||
| export function getBrowserInfo() { | ||
| const ua = navigator.userAgent | ||
|
|
||
| const isIOS = /(iPhone|iPad|iPod|iOS)/i.test(ua) | ||
| const isMac = ua.match(/(Mac OS X)\s([\d_]+)/i) | ||
| const isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(ua) | ||
|
|
||
| const isSafari = ua.indexOf('Safari') !== -1 && ua.indexOf('Chrome') === -1 | ||
| const isWx = /MicroMessenger/i.test(ua) | ||
| return { | ||
| isIOS, | ||
| isMobile, | ||
| isMac, | ||
| isSafari, | ||
| isWx | ||
| } | ||
| } |
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