Welcome What's new in Chrome extensions API reference Samples
Welcome What's new in Chrome extensions API reference Samples

chrome.enterprise.deviceAttributes

Important: This API works only on ChromeOS
  • Description

    Use the chrome.enterprise.deviceAttributes API to read device attributes. Note: This API is only available to extensions force-installed by enterprise policy.

  • Permissions
    enterprise.deviceAttributes
  • Availability
    Chrome 46+ ChromeOS only Requires policy

Note: This API is only for extensions pre-installed by policy.

Summary

Methods

getDeviceAnnotatedLocation

chrome.enterprise.deviceAttributes.getDeviceAnnotatedLocation(
  callback?: function,
)
Promise Chrome 66+

Fetches the administrator-annotated Location. If the current user is not affiliated or no Annotated Location has been set by the administrator, returns an empty string.

Parameters

  • callback

    function optional

    The callback parameter looks like: (annotatedLocation: string) => void

    • annotatedLocation

      string

Returns

  • Promise<string>

    Chrome 96+

    Promises are supported in Manifest V3 and later, but callbacks are provided for backward compatibility. You cannot use both on the same function call. The promise resolves with the same type that is passed to the callback.

getDeviceAssetId

chrome.enterprise.deviceAttributes.getDeviceAssetId(
  callback?: function,
)
Promise Chrome 66+

Fetches the administrator-annotated Asset Id. If the current user is not affiliated or no Asset Id has been set by the administrator, returns an empty string.

Parameters

  • callback

    function optional

    The callback parameter looks like: (assetId: string) => void

    • assetId

      string

Returns

  • Promise<string>

    Chrome 96+

    Promises are supported in Manifest V3 and later, but callbacks are provided for backward compatibility. You cannot use both on the same function call. The promise resolves with the same type that is passed to the callback.

getDeviceHostname

chrome.enterprise.deviceAttributes.getDeviceHostname(
  callback?: function,
)
Promise Chrome 82+

Fetches the device's hostname as set by DeviceHostnameTemplate policy. If the current user is not affiliated or no hostname has been set by the enterprise policy, returns an empty string.

Parameters

  • callback

    function optional

    The callback parameter looks like: (hostname: string) => void

    • hostname

      string

Returns

  • Promise<string>

    Chrome 96+

    Promises are supported in Manifest V3 and later, but callbacks are provided for backward compatibility. You cannot use both on the same function call. The promise resolves with the same type that is passed to the callback.

getDeviceSerialNumber

chrome.enterprise.deviceAttributes.getDeviceSerialNumber(
  callback?: function,
)
Promise Chrome 66+

Fetches the device's serial number. Please note the purpose of this API is to administrate the device (e.g. generating Certificate Sign Requests for device-wide certificates). This API may not be used for tracking devices without the consent of the device's administrator. If the current user is not affiliated, returns an empty string.

Parameters

  • callback

    function optional

    The callback parameter looks like: (serialNumber: string) => void

    • serialNumber

      string

Returns

  • Promise<string>

    Chrome 96+

    Promises are supported in Manifest V3 and later, but callbacks are provided for backward compatibility. You cannot use both on the same function call. The promise resolves with the same type that is passed to the callback.

getDirectoryDeviceId

chrome.enterprise.deviceAttributes.getDirectoryDeviceId(
  callback?: function,
)
Promise

Fetches the value of the device identifier of the directory API, that is generated by the server and identifies the cloud record of the device for querying in the cloud directory API. If the current user is not affiliated, returns an empty string.

Parameters

  • callback

    function optional

    The callback parameter looks like: (deviceId: string) => void

    • deviceId

      string

Returns

  • Promise<string>

    Chrome 96+

    Promises are supported in Manifest V3 and later, but callbacks are provided for backward compatibility. You cannot use both on the same function call. The promise resolves with the same type that is passed to the callback.

This site uses cookies to deliver and enhance the quality of its services and to analyze traffic. If you agree, cookies are also used to serve advertising and to personalize the content and advertisements that you see. Learn more about our use of cookies.