selenium.webdriver.common.bidi.permissionsΒΆ

Classes

PermissionDescriptor(name)

Represents a permission descriptor.

PermissionState()

Represents the possible permission states.

Permissions(conn)

BiDi implementation of the permissions module.

class selenium.webdriver.common.bidi.permissions.PermissionState[source]ΒΆ

Represents the possible permission states.

GRANTED = 'granted'ΒΆ
DENIED = 'denied'ΒΆ
PROMPT = 'prompt'ΒΆ
class selenium.webdriver.common.bidi.permissions.PermissionDescriptor(name: str)[source]ΒΆ

Represents a permission descriptor.

to_dict() β†’ dict[source]ΒΆ
class selenium.webdriver.common.bidi.permissions.Permissions(conn)[source]ΒΆ

BiDi implementation of the permissions module.

set_permission(descriptor: str | PermissionDescriptor, state: str, origin: str, user_context: str | None = None) β†’ None[source]ΒΆ

Sets a permission state for a given permission descriptor.

Parameters:ΒΆ

descriptor: The permission name (str) or PermissionDescriptor object.

Examples: β€œgeolocation”, β€œcamera”, β€œmicrophone”

state: The permission state (granted, denied, prompt). origin: The origin for which the permission is set. user_context: The user context id (optional).

Raises:ΒΆ

ValueError: If the permission state is invalid.