mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-20 04:01:20 -08:00
fix: enhance user agent detection to support custom user agent
This commit is contained in:
1 parent
dd57cc2a03
commit
6c4e9f7e78
27 files changed
+324
-283
No files matched your search
@@ -1,4 +1,4 @@
|
||||
export const userAgent = typeof navigator !== 'undefined' ? navigator.userAgent : '';
|
||||
export const userAgent = globalThis?.CUSTOM_USER_AGENT ?? (typeof navigator !== 'undefined' ? navigator.userAgent : '');
|
||||
export const isSafari = /^((?!chrome|android).)*safari/i.test(userAgent);
|
||||
export const isWechat = /MicroMessenger/i.test(userAgent);
|
||||
export const isIE = /MSIE|Trident/i.test(userAgent);
|
||||
|
||||
Reference in new issue
Block a user