Device - puppeteerApp
Kind: global class
手机设备相关功能
Device.width
获取设备屏幕宽度 Get the device screen width
Kind: static property of Device
Device.height
获取设备屏幕高度 Get the device screen height
Kind: static property of Device
Device.rotation
获取设备屏幕旋转方向 Get the device screen rotation
Kind: static property of Device
Device.density
获取设备屏幕密度 Get the device screen density
Kind: static property of Device
Device.isPortrait
检查设备是否处于纵向模式 Check if the device is in portrait mode
Kind: static property of Device
Device.isLandscape
检查设备是否处于横向模式 Check if the device is in landscape mode
Kind: static property of Device
Device.screenWidthForOrientation
获取指定方向下的设备屏幕宽度 Get the screen width for a specific orientation
Kind: static property of Device
Param | Type | Description |
---|---|---|
orientation | string | 方向 (Orientation) |
Device.screenHeightForOrientation
获取指定方向下的设备屏幕高度 Get the screen height for a specific orientation
Kind: static property of Device
Param | Type | Description |
---|---|---|
orientation | string | 方向 (Orientation) |
Device.isWifi
检查设备是否连接到WiFi Check if the device is connected to WiFi
Kind: static property of Device