💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
~~~ var BrowserInfo = { userAgent: navigator.userAgent.toLowerCase() isAndroid: Boolean(navigator.userAgent.match(/android/ig)), isIphone: Boolean(navigator.userAgent.match(/iphone|ipod/ig)), isIpad: Boolean(navigator.userAgent.match(/ipad/ig)), isWeixin: Boolean(navigator.userAgent.match(/MicroMessenger/ig)), } ~~~ ~~~ /** * 判断是否移动设备 */ function isMobile() { if (typeof this._isMobile === 'boolean') { return this._isMobile; } var screenWidth = this.getScreenWidth(); var fixViewPortsExperiment = rendererModel.runningExperiments.FixViewport || rendererModel.runningExperiments.fixviewport; var fixViewPortsExperimentRunning = fixViewPortsExperiment && (fixViewPortsExperiment.toLowerCase() === "new"); if (!fixViewPortsExperiment) { if (!this.isAppleMobileDevice()) { screenWidth = screenWidth / window.devicePixelRatio; } } var isMobileScreenSize = screenWidth < 600; var isMobileUserAgent = false; this._isMobile = isMobileScreenSize && this.isTouchScreen(); return this._isMobile; } ~~~ ~~~ /** * 判断是否移动设备访问 */ function isMobileUserAgent() { return (/iphone|ipod|android.*mobile|windows.*phone|blackberry.*mobile/i .test(window.navigator.userAgent.toLowerCase())); } ~~~ ~~~ /** * 判断是否苹果移动设备访问 */ function isAppleMobileDevice() { return (/iphone|ipod|ipad|Macintosh/i.test(navigator.userAgent .toLowerCase())); } ~~~ ~~~ /** * 判断是否安卓移动设备访问 */ function isAndroidMobileDevice() { return (/android/i.test(navigator.userAgent.toLowerCase())); } ~~~ ~~~ /** * 判断是否Touch屏幕 */ function isTouchScreen() { return (('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch); } ~~~ ~~~ /** * 判断是否在安卓上的谷歌浏览器 */ function isNewChromeOnAndroid() { if (this.isAndroidMobileDevice()) { var userAgent = navigator.userAgent.toLowerCase(); if ((/chrome/i.test(userAgent))) { var parts = userAgent.split('chrome/'); var fullVersionString = parts[1].split(" ")[0]; var versionString = fullVersionString.split('.')[0]; var version = parseInt(versionString); if (version >= 27) { return true; } } } return false; } ~~~