:right-sidebar: True WebPage =================================================================== .. currentmodule:: gi.repository.WebKitWebProcessExtension .. class:: WebPage(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.GObject.Object` :Constructors: :: WebPage(**properties) Methods ------- .. rst-class:: interim-class .. class:: WebPage :no-index: .. method:: get_editor() -> ~gi.repository.WebKitWebProcessExtension.WebEditor Gets the :obj:`~gi.repository.WebKitWebProcessExtension.WebEditor` of a :obj:`~gi.repository.WebKitWebProcessExtension.WebPage`. .. versionadded:: 2.10 .. method:: get_form_manager(world: ~gi.repository.WebKitWebProcessExtension.ScriptWorld | None = None) -> ~gi.repository.WebKitWebProcessExtension.WebFormManager Get the :obj:`~gi.repository.WebKitWebProcessExtension.WebFormManager` of ``web_page`` in ``world``. .. versionadded:: 2.40 :param world: a :obj:`~gi.repository.WebKitWebProcessExtension.ScriptWorld` .. method:: get_id() -> int Get the identifier of the :obj:`~gi.repository.WebKitWebProcessExtension.WebPage` .. method:: get_main_frame() -> ~gi.repository.WebKitWebProcessExtension.Frame Returns the main frame of a :obj:`~gi.repository.WebKitWebProcessExtension.WebPage`. .. versionadded:: 2.2 .. method:: 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``. .. method:: send_message_to_view(message: ~gi.repository.WebKit.UserMessage, cancellable: ~gi.repository.Gio.Cancellable | None = None, callback: ~typing.Callable[[...], None] | None = None, *user_data: ~typing.Any) -> 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 :const:`None` as ``callback``. When the operation is finished, ``callback`` will be called. You can then call :func:`~gi.repository.WebKitWebProcessExtension.WebPage.send_message_to_view_finish` to get the message reply. .. versionadded:: 2.28 :param message: a :obj:`~gi.repository.WebKitWebProcessExtension.UserMessage` :param cancellable: a :obj:`~gi.repository.Gio.Cancellable` or :const:`None` to ignore :param callback: A :obj:`~gi.repository.Gio.AsyncReadyCallback` to call when the request is satisfied or :const:`None` :param user_data: the data to pass to callback function .. method:: send_message_to_view_finish(result: ~gi.repository.Gio.AsyncResult) -> ~gi.repository.WebKit.UserMessage Finish an asynchronous operation started with :func:`~gi.repository.WebKitWebProcessExtension.WebPage.send_message_to_view`. .. versionadded:: 2.28 :param result: a :obj:`~gi.repository.Gio.AsyncResult` Properties ---------- .. rst-class:: interim-class .. class:: WebPage :no-index: .. attribute:: props.uri :type: str The current active URI of the :obj:`~gi.repository.WebKitWebProcessExtension.WebPage`. Signals ------- .. rst-class:: interim-class .. class:: WebPage.signals :no-index: .. method:: context_menu(context_menu: ~gi.repository.WebKit.ContextMenu, hit_test_result: ~gi.repository.WebKitWebProcessExtension.WebHitTestResult) -> 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. .. versionadded:: 2.8 :param context_menu: the proposed :obj:`~gi.repository.WebKitWebProcessExtension.ContextMenu` :param hit_test_result: a :obj:`~gi.repository.WebKitWebProcessExtension.WebHitTestResult` .. method:: document_loaded() -> None This signal is emitted when the DOM document of a :obj:`~gi.repository.WebKitWebProcessExtension.WebPage` has been loaded. You can wait for this signal to get the DOM document .. method:: send_request(request: ~gi.repository.WebKit.URIRequest, redirected_response: ~gi.repository.WebKit.URIResponse) -> bool This signal is emitted when ``request`` is about to be sent to the server. This signal can be used to modify the :obj:`~gi.repository.WebKitWebProcessExtension.URIRequest` that will be sent to the server. You can also cancel the resource load operation by connecting to this signal and returning :const:`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 :obj:`~gi.repository.WebKitWebProcessExtension.URIRequest` and its associated :obj:`~gi.repository.Soup.MessageHeaders` will be taken into account when the request is sent over the network. :param request: a :obj:`~gi.repository.WebKitWebProcessExtension.URIRequest` :param redirected_response: a :obj:`~gi.repository.WebKitWebProcessExtension.URIResponse`, or :const:`None` .. method:: user_message_received(message: ~gi.repository.WebKit.UserMessage) -> bool This signal is emitted when a :obj:`~gi.repository.WebKitWebProcessExtension.UserMessage` is received from the ``WebKitWebView`` corresponding to ``web_page``. You can reply to the message using :func:`~gi.repository.WebKitWebProcessExtension.UserMessage.send_reply`. You can handle the user message asynchronously by calling :func:`~gi.repository.GObject.GObject.Object.ref` on ``message`` and returning :const:`True`. If the last reference of ``message`` is removed and the message has been replied, the operation in the ``WebKitWebView`` will finish with error :const:`~gi.repository.WebKitWebProcessExtension.UserMessageError.USER_MESSAGE_UNHANDLED_MESSAGE`. .. versionadded:: 2.28 :param message: the :obj:`~gi.repository.WebKitWebProcessExtension.UserMessage` received