Function
Static Public Summary | ||
public |
detect(ua: *, platform: *) |
|
public |
getWechatVersion(ua: string): string Get wechat version |
|
public |
getWxworkVersion(ua: string): string Get wxwork version |
|
public |
isWeappWebview(ua: string): boolean Is it weapp webview |
|
public |
isWechatWebview(ua: string): boolean Is it wechat webview |
|
public |
isWxworkWebview(ua: string): boolean Is it Wxwork webview |
Static Public
public detect(ua: *, platform: *) source
import detect from 'in-which-browser/src/zepto-detect.js'
Params:
Name | Type | Attribute | Description |
ua | * | ||
platform | * |
public getWechatVersion(ua: string): string source
import {getWechatVersion} from 'in-which-browser/src/wechat.js'
Get wechat version
Params:
Name | Type | Attribute | Description |
ua | string |
public getWxworkVersion(ua: string): string source
import {getWxworkVersion} from 'in-which-browser/src/wxwork.js'
Get wxwork version
Params:
Name | Type | Attribute | Description |
ua | string |
public isWeappWebview(ua: string): boolean source
import isWeappWebview from 'in-which-browser/src/weapp.js'
Is it weapp webview
- 在网页内可通过window.__wxjs_environment变量判断是否在小程序环境,建议在WeixinJSBridgeReady回调中使用,也可以使用JSSDK 1.3.2提供的getEnv接口。
- 从微信7.0.0开始,可以通过判断userAgent中包含miniProgram字样来判断小程序web-view环境
Params:
Name | Type | Attribute | Description |
ua | string |
public isWechatWebview(ua: string): boolean source
import {isWechatWebview} from 'in-which-browser/src/wechat.js'
Is it wechat webview
Params:
Name | Type | Attribute | Description |
ua | string |
public isWxworkWebview(ua: string): boolean source
import {isWxworkWebview} from 'in-which-browser/src/wxwork.js'
Is it Wxwork webview
Params:
Name | Type | Attribute | Description |
ua | string |