setPermission method

Future<void> setPermission(
  1. PermissionDescriptor permission,
  2. PermissionSetting setting, {
  3. String? origin,
  4. BrowserContextID? browserContextId,
})

Set permission settings for given origin. permission Descriptor of permission to override. setting Setting of the permission. origin Origin the permission applies to, all origins if not specified. browserContextId Context to override. When omitted, default browser context is used.

Implementation

Future<void> setPermission(
    PermissionDescriptor permission, PermissionSetting setting,
    {String? origin, BrowserContextID? browserContextId}) async {
  await _client.send('Browser.setPermission', {
    'permission': permission,
    'setting': setting,
    if (origin != null) 'origin': origin,
    if (browserContextId != null) 'browserContextId': browserContextId,
  });
}