background_service
BackgroundServiceEvent
dataclass
Source code in zendriver/cdp/background_service.py
event_metadata: typing.List[EventMetadata]
instance-attribute
event_name: str
instance-attribute
instance_id: str
instance-attribute
origin: str
instance-attribute
service: ServiceName
instance-attribute
service_worker_registration_id: service_worker.RegistrationID
instance-attribute
storage_key: str
instance-attribute
timestamp: network.TimeSinceEpoch
instance-attribute
__init__(timestamp, origin, service_worker_registration_id, service, event_name, instance_id, event_metadata, storage_key)
from_json(json)
classmethod
Source code in zendriver/cdp/background_service.py
to_json()
Source code in zendriver/cdp/background_service.py
BackgroundServiceEventReceived
dataclass
Called with all existing backgroundServiceEvents when enabled, and all new events afterwards if enabled and recording.
Source code in zendriver/cdp/background_service.py
background_service_event: BackgroundServiceEvent
instance-attribute
__init__(background_service_event)
EventMetadata
dataclass
A key-value pair for additional event information to pass along.
Source code in zendriver/cdp/background_service.py
key: str
instance-attribute
value: str
instance-attribute
__init__(key, value)
from_json(json)
classmethod
RecordingStateChanged
dataclass
Called when the recording state for the service has been updated.
Source code in zendriver/cdp/background_service.py
is_recording: bool
instance-attribute
service: ServiceName
instance-attribute
__init__(is_recording, service)
ServiceName
Bases: Enum
The Background Service that will be associated with the commands/events. Every Background Service operates independently, but they share the same API.
Source code in zendriver/cdp/background_service.py
BACKGROUND_FETCH = 'backgroundFetch'
class-attribute
instance-attribute
BACKGROUND_SYNC = 'backgroundSync'
class-attribute
instance-attribute
NOTIFICATIONS = 'notifications'
class-attribute
instance-attribute
PAYMENT_HANDLER = 'paymentHandler'
class-attribute
instance-attribute
PERIODIC_BACKGROUND_SYNC = 'periodicBackgroundSync'
class-attribute
instance-attribute
PUSH_MESSAGING = 'pushMessaging'
class-attribute
instance-attribute
from_json(json)
classmethod
clear_events(service)
Clears all stored data for the service.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
service
|
ServiceName
|
|
required |
Source code in zendriver/cdp/background_service.py
set_recording(should_record, service)
Set the recording state for the service.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
should_record
|
bool
|
|
required |
service
|
ServiceName
|
|
required |
Source code in zendriver/cdp/background_service.py
start_observing(service)
Enables event updates for the service.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
service
|
ServiceName
|
|
required |
Source code in zendriver/cdp/background_service.py
stop_observing(service)
Disables event updates for the service.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
service
|
ServiceName
|
|
required |