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.