Session¶
SessionModule ¶
Module for managing the BiDi session.
Source code in bidiwave/modules/session.py
end
async
¶
subscribe
async
¶
subscribe(events: list[str], contexts: list[str] | None = None, user_contexts: list[str] | None = None) -> dict[str, Any]
Subscribes to browser events.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
events
|
list[str]
|
Event names to subscribe to. |
required |
contexts
|
list[str] | None
|
Scope to top-level browsing context IDs. |
None
|
user_contexts
|
list[str] | None
|
Scope to user context IDs. |
None
|
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
Subscription result from the server (contains "subscription" |
dict[str, Any]
|
with the subscription ID on supporting implementations). |
Source code in bidiwave/modules/session.py
unsubscribe
async
¶
unsubscribe(events: list[str] | None = None, contexts: list[str] | None = None, subscriptions: list[str] | None = None) -> None
Unsubscribes from events.
Either events (+ optional contexts) or subscriptions must
be given — the two forms are mutually exclusive per the spec.