WebProcessExtension
Added in version 2.40.
Superclasses: Object
- Constructors:
WebProcessExtension(**properties)
Methods
- class WebProcessExtension
- get_page(page_id: int) WebPage
Get the web page of the given
page_id
.Added in version 2.40.
- Parameters:
page_id – the identifier of the
WebPage
to get
- send_message_to_context(message: UserMessage, cancellable: Cancellable | None = None, callback: Callable[[...], None] | None = None, *user_data: Any) None
Send
message
to theWebKitWebContext
corresponding toextension
. Ifmessage
is floating, it’s consumed.If you don’t expect any reply, or you simply want to ignore it, you can pass
None
ascalback
. When the operation is finished,callback
will be called. You can then callsend_message_to_context_finish()
to get the message reply.Added in version 2.40.
- Parameters:
message – a
UserMessage
cancellable – a
Cancellable
orNone
to ignorecallback – A
AsyncReadyCallback
to call when the request is satisfied orNone
user_data – the data to pass to callback function
- send_message_to_context_finish(result: AsyncResult) UserMessage
Finish an asynchronous operation started with
send_message_to_context()
.Added in version 2.40.
- Parameters:
result – a
AsyncResult
Signals
- class WebProcessExtension.signals
- page_created(web_page: WebPage) None
This signal is emitted when a new
WebPage
is created in the Web Process.Added in version 2.40.
- Parameters:
web_page – the
WebPage
created
- user_message_received(message: UserMessage) None
This signal is emitted when a
UserMessage
is received from theWebKitWebContext
corresponding toextension
. Messages sent byWebKitWebContext
are always broadcasted to all web extensions and they can’t be replied to. Callingsend_reply()
will do nothing.Added in version 2.40.
- Parameters:
message – the
UserMessage
received