WebKit2WebExtension.WebExtension

g GObject.Object GObject.Object WebKit2WebExtension.WebExtension WebKit2WebExtension.WebExtension GObject.Object->WebKit2WebExtension.WebExtension

Subclasses:None

Methods

Inherited:GObject.Object (37)
Structs:GObject.ObjectClass (5)
  get_page (page_id)
  send_message_to_context (message, cancellable, callback, *user_data)
  send_message_to_context_finish (result)

Virtual Methods

Inherited:GObject.Object (7)

Properties

None

Signals

Inherited:GObject.Object (1)
Name Short Description
page-created This signal is emitted when a new WebKit2WebExtension.WebPage is created in the Web Process.
user-message-received This signal is emitted when a WebKit2WebExtension.UserMessage is received from the #WebKitWebContext corresponding to extension.

Fields

Inherited:GObject.Object (1)
Name Type Access Description
parent GObject.Object r  

Class Details

class WebKit2WebExtension.WebExtension(**kwargs)
Bases:GObject.Object
Abstract:No
Structure:WebKit2WebExtension.WebExtensionClass
get_page(page_id)
Parameters:page_id (int) – the identifier of the WebKit2WebExtension.WebPage to get
Returns:the WebKit2WebExtension.WebPage for the given page_id, or None if the identifier doesn’t correspond to an existing web page.
Return type:WebKit2WebExtension.WebPage

Get the web page of the given page_id.

send_message_to_context(message, cancellable, callback, *user_data)
Parameters:

Send message to the #WebKitWebContext corresponding to self. 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 WebKit2WebExtension.WebExtension.send_message_to_context_finish() to get the message reply.

New in version 2.28.

send_message_to_context_finish(result)
Parameters:result (Gio.AsyncResult) – a Gio.AsyncResult
Raises:GLib.Error
Returns:a WebKit2WebExtension.UserMessage with the reply or None in case of error.
Return type:WebKit2WebExtension.UserMessage

Finish an asynchronous operation started with WebKit2WebExtension.WebExtension.send_message_to_context().

New in version 2.28.

Signal Details

WebKit2WebExtension.WebExtension.signals.page_created(web_extension, web_page)
Signal Name:

page-created

Flags:

RUN_LAST

Parameters:

This signal is emitted when a new WebKit2WebExtension.WebPage is created in the Web Process.

WebKit2WebExtension.WebExtension.signals.user_message_received(web_extension, message)
Signal Name:

user-message-received

Flags:

RUN_LAST

Parameters:

This signal is emitted when a WebKit2WebExtension.UserMessage is received from the #WebKitWebContext corresponding to extension. Messages sent by #WebKitWebContext are always broadcasted to all WebKit2WebExtension.WebExtension s and they can’t be replied to. Calling WebKit2WebExtension.UserMessage.send_reply() will do nothing.

New in version 2.28.