grantPermissions method

Future<void> grantPermissions(
  1. List<PermissionType> permissions, {
  2. String? origin,
  3. BrowserContextID? browserContextId,
})

Grant specific permissions to the given origin and reject all others. origin Origin the permission applies to, all origins if not specified. browserContextId BrowserContext to override permissions. When omitted, default browser context is used.

Implementation

Future<void> grantPermissions(List<PermissionType> permissions,
    {String? origin, BrowserContextID? browserContextId}) async {
  await _client.send('Browser.grantPermissions', {
    'permissions': [...permissions],
    if (origin != null) 'origin': origin,
    if (browserContextId != null) 'browserContextId': browserContextId,
  });
}