MAIDR JavaScript API
    Preparing search index...

    Function allowsDeviceFeature

    • Reports whether this page can use one of the browser's device APIs.

      All three are gated by Permissions Policy, and being gated out does not reliably remove them: the policy has to be asked, not inferred from whether the object exists. Detecting rather than assuming is what keeps a device control from offering itself where it cannot work.

      Parameters

      Returns boolean

      True when the API is there and the page may use it