WebPage#

class WebPage(**properties: Any)#

Superclasses: Object

A loaded web page.

Methods#

class WebPage
get_editor() WebEditor#

Gets the WebEditor of a WebPage.

Added in version 2.10.

get_form_manager(world: ScriptWorld | None = None) WebFormManager#

Get the WebFormManager of web_page in world.

Added in version 2.40.

Parameters:

world – a ScriptWorld

get_id() int#

Get the identifier of the WebPage

get_main_frame() Frame#

Returns the main frame of a WebPage.

Added in version 2.2.

get_uri() str#

Returns the current active URI of web_page.

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

send_message_to_view(message: UserMessage, cancellable: Cancellable | None = None, callback: Callable[[Object | None, AsyncResult, Any], None] | None = None, user_data: Any = None) None#

Send message to the WebKitWebView corresponding to web_page. 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 send_message_to_view_finish() to get the message reply.

Added in version 2.28.

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_view_finish(result: AsyncResult) UserMessage#

Finish an asynchronous operation started with send_message_to_view().

Added in version 2.28.

Parameters:

result – a AsyncResult

Properties#

class WebPage
props.uri: str#

The type of the None singleton.

Signals#

class WebPage.signals
console_message_sent(console_message: ConsoleMessage) None#

The type of the None singleton.

Added in version 2.12.

Parameters:

console_message – the ConsoleMessage

context_menu(context_menu: ContextMenu, hit_test_result: WebHitTestResult) bool#

The type of the None singleton.

Added in version 2.8.

Parameters:
document_loaded() None#

The type of the None singleton.

send_request(request: URIRequest, redirected_response: URIResponse) bool#

The type of the None singleton.

Parameters:
user_message_received(message: UserMessage) bool#

The type of the None singleton.

Added in version 2.28.

Parameters:

message – the UserMessage received