WebPage#
Superclasses: Object
A loaded web page.
Methods#
- class WebPage
-
- get_form_manager(world: ScriptWorld | None = None) WebFormManager#
Get the
WebFormManagerofweb_pageinworld.Added in version 2.40.
- Parameters:
world – a
ScriptWorld
- get_main_frame() Frame#
Returns the main frame of a
WebPage.Added in version 2.2.
Deprecated since version 2.48: Please do not use it in newly written code
- 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.
- async send_message_to_view(self, message: UserMessage) UserMessage#
This is the awaitable version of
send_message_to_view().Added in version 2.28.
- Parameters:
message – a
UserMessage
- 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
messageto theWebKitWebViewcorresponding toweb_page. Ifmessageis floating, it’s consumed.If you don’t expect any reply, or you simply want to ignore it, you can pass
Noneascallback. When the operation is finished,callbackwill be called. You can then callsend_message_to_view_finish()to get the message reply.Added in version 2.28.
- Parameters:
message – a
UserMessagecancellable – a
CancellableorNoneto ignorecallback – A
AsyncReadyCallbackto call when the request is satisfied orNoneuser_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#
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
The type of the None singleton.
Added in version 2.8.
- Parameters:
context_menu – the proposed
ContextMenuhit_test_result – a
WebHitTestResult
- send_request(request: URIRequest, redirected_response: URIResponse) bool#
The type of the None singleton.
- Parameters:
request – a
URIRequestredirected_response – a
URIResponse, orNone
- user_message_received(message: UserMessage) bool#
The type of the None singleton.
Added in version 2.28.
- Parameters:
message – the
UserMessagereceived