WebKit2WebExtension.WebFormManager¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
class |
|
Virtual Methods¶
- Inherited:
Properties¶
None
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Emitted after form elements (or form associated elements) are associated to frame. |
|
This signal is emitted when the DOM submit event is about to be fired for form. |
|
This signal is emitted when form will imminently be submitted. |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent |
r |
Class Details¶
- class WebKit2WebExtension.WebFormManager(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
Form manager of a
WebKit2WebExtension.WebPage
in aWebKit2WebExtension.ScriptWorld
New in version 2.40.
- classmethod input_element_auto_fill(element, value)¶
- Parameters:
element (
JavaScriptCore.Value
) – aJavaScriptCore.Value
value (
str
) – the text to set
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.
New in version 2.40.
- classmethod input_element_is_auto_filled(element)¶
- Parameters:
element (
JavaScriptCore.Value
) – aJavaScriptCore.Value
- Returns:
True
if element is an HTML input element that has been filled automatically, orFalse
otherwise- Return type:
Get whether element is an HTML input element that has been filled automatically.
New in version 2.40.
- classmethod input_element_is_user_edited(element)¶
- Parameters:
element (
JavaScriptCore.Value
) – aJavaScriptCore.Value
- Returns:
True
if element is an HTML text input element that has been edited by a user action, orFalse
otherwise- Return type:
Get whether element is an HTML text input element that has been edited by a user action.
New in version 2.40.
Signal Details¶
- WebKit2WebExtension.WebFormManager.signals.form_controls_associated(web_form_manager, frame, elements)¶
- Signal Name:
form-controls-associated
- Flags:
- Parameters:
web_form_manager (
WebKit2WebExtension.WebFormManager
) – The object which received the signalframe (
WebKit2WebExtension.Frame
) – aWebKit2WebExtension.Frame
elements ([
JavaScriptCore.Value
]) – aGLib.PtrArray
ofJavaScriptCore.Value
with the list of forms in the page
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.
New in version 2.40.
- WebKit2WebExtension.WebFormManager.signals.will_send_submit_event(web_form_manager, form, source_frame, target_frame)¶
- Signal Name:
will-send-submit-event
- Flags:
- Parameters:
web_form_manager (
WebKit2WebExtension.WebFormManager
) – The object which received the signalform (
JavaScriptCore.Value
) – theJavaScriptCore.Value
to be submitted, which will always correspond to an HTMLFormElementsource_frame (
WebKit2WebExtension.Frame
) – theWebKit2WebExtension.Frame
containing the form to be submittedtarget_frame (
WebKit2WebExtension.Frame
) – theWebKit2WebExtension.Frame
containing the form’s target, which may be the same as source_frame if no target was specified
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
WebKit2WebExtension.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.New in version 2.40.
- WebKit2WebExtension.WebFormManager.signals.will_submit_form(web_form_manager, form, source_frame, target_frame)¶
- Signal Name:
will-submit-form
- Flags:
- Parameters:
web_form_manager (
WebKit2WebExtension.WebFormManager
) – The object which received the signalform (
JavaScriptCore.Value
) – theJavaScriptCore.Value
to be submitted, which will always correspond to an HTMLFormElementsource_frame (
WebKit2WebExtension.Frame
) – theWebKit2WebExtension.Frame
containing the form to be submittedtarget_frame (
WebKit2WebExtension.Frame
) – theWebKit2WebExtension.Frame
containing the form’s target, which may be the same as source_frame if no target was specified
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
WebKit2WebExtension.WebFormManager
::will-send-submit-event
if that signal is emitted.New in version 2.40.