说明
使用 chrome.enterprise.deviceAttributes
API 读取设备属性。注意:此 API 仅适用于根据企业政策强制安装的扩展程序。
权限
enterprise.deviceAttributes
可用性
方法
getDeviceAnnotatedLocation()
Chrome 66 及更高版本
chrome.enterprise.deviceAttributes.getDeviceAnnotatedLocation(): Promise<string>
获取管理员注释的位置信息。如果当前用户没有关联的组织,或者管理员未设置带注释的位置,则返回空字符串。
返回
-
Promise<string>
Chrome 96 及更高版本
getDeviceAssetId()
Chrome 66 及更高版本
chrome.enterprise.deviceAttributes.getDeviceAssetId(): Promise<string>
获取管理员注释的资产 ID。如果当前用户没有关联的资产,或者管理员未设置任何资产 ID,则返回空字符串。
返回
-
Promise<string>
Chrome 96 及更高版本
getDeviceHostname()
Chrome 82 及更高版本
chrome.enterprise.deviceAttributes.getDeviceHostname(): Promise<string>
获取由 DeviceHostnameTemplate 政策设置的设备主机名。如果当前用户未关联或企业政策未设置主机名,则返回空字符串。
返回
-
Promise<string>
Chrome 96 及更高版本
getDeviceSerialNumber()
Chrome 66 及更高版本
chrome.enterprise.deviceAttributes.getDeviceSerialNumber(): Promise<string>
获取设备的序列号。请注意,此 API 的目的是管理设备(例如,为设备级证书生成证书签名请求)。未经设备管理员同意,不得使用此 API 跟踪设备。如果当前用户没有关联的商家,则返回空字符串。
返回
-
Promise<string>
Chrome 96 及更高版本
getDirectoryDeviceId()
chrome.enterprise.deviceAttributes.getDirectoryDeviceId(): Promise<string>
获取 Directory API 的设备标识符的值,该值由服务器生成,用于标识设备在 Cloud Directory API 中的云记录,以便在 Cloud Directory API 中进行查询。如果当前用户没有关联的商家,则返回空字符串。
返回
-
Promise<string>
Chrome 96 及更高版本