fix(weixin-sdk): fix iOS scanQRCode false camera permission error
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,3 +1,15 @@
|
||||
/** 是否 iOS 设备(不含微信开发者工具模拟器特殊处理) */
|
||||
export function isIosDevice(): boolean {
|
||||
if (typeof navigator === 'undefined') return false;
|
||||
return /iPad|iPhone|iPod/.test(navigator.userAgent) && !(window as Window & { MSStream?: unknown }).MSStream;
|
||||
}
|
||||
|
||||
/** 是否微信开发者工具 */
|
||||
export function isWechatDevTools(): boolean {
|
||||
if (typeof navigator === 'undefined') return false;
|
||||
return /wechatdevtools/i.test(navigator.userAgent);
|
||||
}
|
||||
|
||||
/** 是否微信内置浏览器 */
|
||||
export function isWechatBrowser(): boolean {
|
||||
if (typeof navigator === 'undefined') return false;
|
||||
|
||||
Reference in New Issue
Block a user