chrome.enterprise.deviceAttributes
Description
使用 chrome.enterprise.deviceAttributes
API 读取设备属性。注意:此 API 仅适用于由企业策略强制安装的扩展程序。
Permissions
enterprise.deviceAttributes
Availability
Chrome 46+
注意:此 API 仅适用于策略预安装的扩展程序(extensions pre-installed by policy)。
Summary
Methods
Methods
getDeviceAnnotatedLocation
chrome.enterprise.deviceAttributes.getDeviceAnnotatedLocation(
callback?: function,
)
Promise
Chrome 66+
获取管理员注释的位置。如果当前用户没有关联或管理员未设置注释位置,则返回空字符串。
PARAMETERS
callback
function optional
The
callback
parameter looks like:(annotatedLocation: string) => void
annotatedLocation
string
RETURNS
Promise<string>
Pending
这仅在未指定
callback
参数时返回Promise
,并且使用 MV3+。Promise
中的类型与callback
的第一个参数相同。
getDeviceAssetId
chrome.enterprise.deviceAttributes.getDeviceAssetId(
callback?: function,
)
Promise
Chrome 66+
获取管理员注释的资产 ID。如果当前用户没有关联或管理员未设置资产 ID,则返回空字符串。
PARAMETERS
callback
function optional
The
callback
parameter looks like:(assetId: string) => void
assetId
string
RETURNS
Promise<string>
Pending
这仅在未指定
callback
参数时返回Promise
,并且使用 MV3+。Promise
中的类型与callback
的第一个参数相同。
getDeviceHostname
chrome.enterprise.deviceAttributes.getDeviceHostname(
callback?: function,
)
Promise
Chrome 82+
获取由 DeviceHostnameTemplate 策略设置的设备主机名。如果当前用户没有关联或企业策略未设置主机名,则返回空字符串。
PARAMETERS
callback
function optional
The
callback
parameter looks like:(hostname: string) => void
hostname
string
RETURNS
Promise<string>
Pending
这仅在未指定
callback
参数时返回Promise
,并且使用 MV3+。Promise
中的类型与callback
的第一个参数相同。
getDeviceSerialNumber
chrome.enterprise.deviceAttributes.getDeviceSerialNumber(
callback?: function,
)
Promise
Chrome 66+
获取设备的序列号。请注意,此 API 的目的是管理设备(例如,为设备范围的证书生成证书签名请求)。未经设备管理员同意,不得使用此 API 跟踪设备。如果当前用户没有关联,则返回一个空字符串。
PARAMETERS
callback
function optional
The
callback
parameter looks like:(serialNumber: string) => void
serialNumber
string
RETURNS
Promise<string>
Pending
这仅在未指定
callback
参数时返回Promise
,并且使用 MV3+。Promise
中的类型与callback
的第一个参数相同。
getDirectoryDeviceId
chrome.enterprise.deviceAttributes.getDirectoryDeviceId(
callback?: function,
)
Promise
获取目录API的设备标识值the device identifier of the directory API,该值由服务器生成,标识设备的云记录,在云目录API中查询。如果当前用户没有关联,则返回一个空字符串。
PARAMETERS
callback
function optional
The
callback
parameter looks like:(deviceId: string) => void
deviceId
string
RETURNS
Promise<string>
Pending
这仅在未指定
callback
参数时返回Promise
,并且使用 MV3+。Promise
中的类型与callback
的第一个参数相同。
By.一粒技术服务.