:right-sidebar: True WebFormManager =================================================================== .. currentmodule:: gi.repository.WebKitWebProcessExtension .. versionadded:: 2.40 .. class:: WebFormManager(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.GObject.Object` :Constructors: :: WebFormManager(**properties) Methods ------- .. rst-class:: interim-class .. class:: WebFormManager :no-index: .. method:: input_element_auto_fill(element: ~gi.repository.JavaScriptCore.Value, value: str) -> None Set the value of an HTML input element as if it had been edited by the user, triggering a change event, and set it as filled automatically. If ``element`` is not an HTML input element this function does nothing. .. versionadded:: 2.40 :param element: a :obj:`~gi.repository.JavaScriptCore.Value` :param value: the text to set .. method:: input_element_is_auto_filled(element: ~gi.repository.JavaScriptCore.Value) -> bool Get whether ``element`` is an HTML input element that has been filled automatically. .. versionadded:: 2.40 :param element: a :obj:`~gi.repository.JavaScriptCore.Value` .. method:: input_element_is_user_edited(element: ~gi.repository.JavaScriptCore.Value) -> bool Get whether ``element`` is an HTML text input element that has been edited by a user action. .. versionadded:: 2.40 :param element: a :obj:`~gi.repository.JavaScriptCore.Value` Signals ------- .. rst-class:: interim-class .. class:: WebFormManager.signals :no-index: .. method:: form_controls_associated(frame: ~gi.repository.WebKitWebProcessExtension.Frame, elements: ~typing.Sequence[~gi.repository.JavaScriptCore.Value]) -> None Emitted after form elements (or form associated elements) are associated to ``frame``. This is useful to implement form auto filling for web pages where form fields are added dynamically. This signal might be emitted multiple times for the same frame. Note that this signal could be also emitted when form controls are moved between forms. In that case, the ``elements`` array carries the list of those elements which have moved. Clients should take a reference to the members of the ``elements`` array if it is desired to keep them alive after the signal handler returns. .. versionadded:: 2.40 :param frame: a :obj:`~gi.repository.WebKitWebProcessExtension.Frame` :param elements: a ``GPtrArray`` of :obj:`~gi.repository.JavaScriptCore.Value` with the list of forms in the page .. method:: will_send_submit_event(form: ~gi.repository.JavaScriptCore.Value, source_frame: ~gi.repository.WebKitWebProcessExtension.Frame, target_frame: ~gi.repository.WebKitWebProcessExtension.Frame) -> None This signal is emitted when the DOM submit event is about to be fired for ``form``. JavaScript code may rely on the submit event to detect that the user has clicked on a submit button, and to possibly cancel the form submission before :obj:`~gi.repository.WebKitWebProcessExtension.WebFormManager`::will-submit-form signal is emitted. However, beware that, for historical reasons, the submit event is not emitted at all if the form submission is triggered by JavaScript. For these reasons, this signal may not be used to reliably detect whether a form will be submitted. Instead, use it to detect if a user has clicked on a form's submit button even if JavaScript later cancels the form submission, or to read the values of the form's fields even if JavaScript later clears certain fields before submitting. This may be needed, for example, to implement a robust browser password manager, as some misguided websites may use such techniques to attempt to thwart password managers. .. versionadded:: 2.40 :param form: the :obj:`~gi.repository.JavaScriptCore.Value` to be submitted, which will always correspond to an HTMLFormElement :param source_frame: the :obj:`~gi.repository.WebKitWebProcessExtension.Frame` containing the form to be submitted :param target_frame: the :obj:`~gi.repository.WebKitWebProcessExtension.Frame` containing the form's target, which may be the same as ``source_frame`` if no target was specified .. method:: will_submit_form(form: ~gi.repository.JavaScriptCore.Value, source_frame: ~gi.repository.WebKitWebProcessExtension.Frame, target_frame: ~gi.repository.WebKitWebProcessExtension.Frame) -> None This signal is emitted when ``form`` will imminently be submitted. It can no longer be cancelled. This event always occurs immediately before a form is submitted to its target, so use this event to reliably detect when a form is submitted. This signal is emitted after :obj:`~gi.repository.WebKitWebProcessExtension.WebFormManager`::will-send-submit-event if that signal is emitted. .. versionadded:: 2.40 :param form: the :obj:`~gi.repository.JavaScriptCore.Value` to be submitted, which will always correspond to an HTMLFormElement :param source_frame: the :obj:`~gi.repository.WebKitWebProcessExtension.Frame` containing the form to be submitted :param target_frame: the :obj:`~gi.repository.WebKitWebProcessExtension.Frame` containing the form's target, which may be the same as ``source_frame`` if no target was specified Fields ------ .. rst-class:: interim-class .. class:: WebFormManager :no-index: .. attribute:: parent