WebKitWebProcessExtension.WebPage

g GObject.Object GObject.Object WebKitWebProcessExtension.WebPage WebKitWebProcessExtension.WebPage GObject.Object->WebKitWebProcessExtension.WebPage

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

get_editor ()

get_form_manager (world)

get_id ()

get_main_frame ()

get_uri ()

send_message_to_view (message, cancellable, callback, *user_data)

send_message_to_view_finish (result)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Name

Type

Flags

Short Description

uri

str

r

Signals

Inherited:

GObject.Object (1)

Name

Short Description

context-menu

Emitted before a context menu is displayed in the UI Process to give the application a chance to customize the proposed menu, build its own context menu or pass user data to the UI Process.

document-loaded

This signal is emitted when the DOM document of a WebKitWebProcessExtension.WebPage has been loaded.

send-request

This signal is emitted when request is about to be sent to the server.

user-message-received

This signal is emitted when a WebKitWebProcessExtension.UserMessage is received from the #WebKitWebView corresponding to web_page.

Fields

Inherited:

GObject.Object (1)

Class Details

class WebKitWebProcessExtension.WebPage(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

WebKitWebProcessExtension.WebPageClass

A loaded web page.

get_editor()
Returns:

the WebKitWebProcessExtension.WebEditor

Return type:

WebKitWebProcessExtension.WebEditor

Gets the WebKitWebProcessExtension.WebEditor of a WebKitWebProcessExtension.WebPage.

New in version 2.10.

get_form_manager(world)
Parameters:

world (WebKitWebProcessExtension.ScriptWorld or None) – a WebKitWebProcessExtension.ScriptWorld

Returns:

a WebKitWebProcessExtension.WebFormManager

Return type:

WebKitWebProcessExtension.WebFormManager

Get the WebKitWebProcessExtension.WebFormManager of self in world.

New in version 2.40.

get_id()
Returns:

the identifier of self

Return type:

int

Get the identifier of the WebKitWebProcessExtension.WebPage

get_main_frame()
Returns:

the WebKitWebProcessExtension.Frame that is the main frame of self

Return type:

WebKitWebProcessExtension.Frame

Returns the main frame of a WebKitWebProcessExtension.WebPage.

New in version 2.2.

get_uri()
Returns:

the current active URI of web_view or None if nothing has been loaded yet.

Return type:

str

Returns the current active URI of self.

You can monitor the active URI by connecting to the notify::uri signal of self.

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

Send message to the #WebKitWebView 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 callback. When the operation is finished, callback will be called. You can then call WebKitWebProcessExtension.WebPage.send_message_to_view_finish() to get the message reply.

New in version 2.28.

send_message_to_view_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult

Raises:

GLib.Error

Returns:

a WebKitWebProcessExtension.UserMessage with the reply or None in case of error.

Return type:

WebKitWebProcessExtension.UserMessage

Finish an asynchronous operation started with WebKitWebProcessExtension.WebPage.send_message_to_view().

New in version 2.28.

Signal Details

WebKitWebProcessExtension.WebPage.signals.context_menu(web_page, context_menu, hit_test_result)
Signal Name:

context-menu

Flags:

RUN_LAST

Parameters:
Returns:

True if the proposed context_menu has been modified, or False otherwise.

Return type:

bool

Emitted before a context menu is displayed in the UI Process to give the application a chance to customize the proposed menu, build its own context menu or pass user data to the UI Process. This signal is useful when the information available in the UI Process is not enough to build or customize the context menu, for example, to add menu entries depending on the node at the coordinates of the hit_test_result. Otherwise, it’s recommended to use #WebKitWebView::context-menu signal instead.

New in version 2.8.

WebKitWebProcessExtension.WebPage.signals.document_loaded(web_page)
Signal Name:

document-loaded

Flags:

RUN_LAST

Parameters:

web_page (WebKitWebProcessExtension.WebPage) – The object which received the signal

This signal is emitted when the DOM document of a WebKitWebProcessExtension.WebPage has been loaded.

You can wait for this signal to get the DOM document

WebKitWebProcessExtension.WebPage.signals.send_request(web_page, request, redirected_response)
Signal Name:

send-request

Flags:

RUN_LAST

Parameters:
Returns:

True to stop other handlers from being invoked for the event. False to continue emission of the event.

Return type:

bool

This signal is emitted when request is about to be sent to the server. This signal can be used to modify the WebKitWebProcessExtension.URIRequest that will be sent to the server. You can also cancel the resource load operation by connecting to this signal and returning True.

In case of a server redirection this signal is emitted again with the request argument containing the new request to be sent to the server due to the redirection and the redirected_response parameter containing the response received by the server for the initial request.

Modifications to the WebKitWebProcessExtension.URIRequest and its associated Soup.MessageHeaders will be taken into account when the request is sent over the network.

WebKitWebProcessExtension.WebPage.signals.user_message_received(web_page, message)
Signal Name:

user-message-received

Flags:

RUN_LAST

Parameters:
Returns:

True if the message was handled, or False otherwise.

Return type:

bool

This signal is emitted when a WebKitWebProcessExtension.UserMessage is received from the #WebKitWebView corresponding to web_page. You can reply to the message using WebKitWebProcessExtension.UserMessage.send_reply().

You can handle the user message asynchronously by calling GObject.Object.ref() on message and returning True. If the last reference of message is removed and the message has been replied, the operation in the #WebKitWebView will finish with error WebKitWebProcessExtension.UserMessageError.USER_MESSAGE_UNHANDLED_MESSAGE.

New in version 2.28.

Property Details

WebKitWebProcessExtension.WebPage.props.uri
Name:

uri

Type:

str

Default Value:

None

Flags:

READABLE

The current active URI of the WebKitWebProcessExtension.WebPage.