WebProcessExtension

Added in version 2.40.

class WebProcessExtension(**properties: Any)

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 the WebKitWebContext corresponding to extension. If message is floating, it’s consumed.

If you don’t expect any reply, or you simply want to ignore it, you can pass None as calback. When the operation is finished, callback will be called. You can then call send_message_to_context_finish() to get the message reply.

Added in version 2.40.

Parameters:
  • message – a UserMessage

  • cancellable – a Cancellable or None to ignore

  • callback – A AsyncReadyCallback to call when the request is satisfied or None

  • 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 the WebKitWebContext corresponding to extension. Messages sent by WebKitWebContext are always broadcasted to all web extensions and they can’t be replied to. Calling send_reply() will do nothing.

Added in version 2.40.

Parameters:

message – the UserMessage received