NavigatorUAData:mobile 属性
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
备注: 此特性在 Web Worker 中可用。
NavigatorUAData
接口的 mobile
只读属性返回一个值,指示设备是否是移动设备。
值
一个布尔值,如果设备是移动设备,则为 true
。
示例
以下示例将 mobile
的值打印到控制台。
js
console.log(navigator.userAgentData.mobile);
规范
Specification |
---|
User-Agent Client Hints # dom-navigatoruadata-mobile |
浏览器兼容性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
mobile |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- No support
- No support
- Experimental. Expect behavior to change in the future.
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
参见
Sec-CH-UA-Mobile
标头(低熵客户端提示)包含相同的信息。