[Home]

Permissions API (WebCompat)

Validates the C-S-S webCompat Permissions API shim and native query path.

Expected behavior: navigator.permissions.query returns the correct state for native permissions (camera and microphone). After granting or denying a permission, the returned state should match the native permission state. For native permissions, the returned name should use the configured override (for example, video_capture or audio_capture).

Bug behavior: when the Permissions API already exists, native permissions may not be intercepted and the returned state can be incorrect or unchanged after granting or denying.

Test steps

  1. Open this page in a DuckDuckGo browser build with the fix.
  2. Check Runtime info for Permissions API presence and query function.
  3. Click Query all and confirm camera and microphone are returned with override names.
  4. Use Request camera and Request microphone, allow or deny, then re-query to confirm state updates.
  5. Use Query (custom) with an invalid name and confirm a TypeError is returned.

Notes: To test the API-present path, ensure webCompat.permissionsPresent is enabled in remote config for this build. The native messaging path is only used for permissions marked native (camera and microphone in the Android override).

Runtime info

Actions

Permission queries

Query name Returned name State Error Updated Action
camera (not queried) - - -
microphone (not queried) - - -
geolocation (not queried) - - -
notifications (not queried) - - -
push (not queried) - - -
(not queried) - - -

Request permission

Log