WebPage.addOnWillSubmitForm

This signal is emitted to indicate various points during form submission. @step indicates the current stage of form submission.

If this signal is emitted with %WEBKIT_FORM_SUBMISSION_WILL_SEND_DOM_EVENT, then the DOM submit event is about to be emitted. 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 %WEBKIT_FORM_SUBMISSION_WILL_COMPLETE. 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, %WEBKIT_FORM_SUBMISSION_WILL_SEND_DOM_EVENT 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.

If this signal is emitted with %WEBKIT_FORM_SUBMISSION_WILL_COMPLETE, the 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 event occurs after %WEBKIT_FORM_SUBMISSION_WILL_SEND_DOM_EVENT if that event is emitted.

class WebPage
gulong
addOnWillSubmitForm
(
void delegate dlg
,
ConnectFlags connectFlags = cast(ConnectFlags)0
)

Meta

Since

2.20