script_dialog


Description:

public virtual signal bool script_dialog (ScriptDialog dialog)

Emitted when JavaScript code calls <function>window.

alert</function>, <function>window.confirm</function> or <function>window.prompt</function>, or when <function >onbeforeunload</function> event is fired. The dialog parameter should be used to build the dialog. If the signal is not handled a different dialog will be built and shown depending on the dialog type: <itemizedlist> <listitem><para> webkit_script_dialog_alert: message dialog with a single Close button. </para></listitem> < listitem><para> webkit_script_dialog_confirm: message dialog with OK and Cancel buttons. </para ></listitem> <listitem><para> webkit_script_dialog_prompt: message dialog with OK and Cancel buttons and a text entry with the default text. </para></listitem> <listitem><para> webkit_script_dialog_before_unload_confirm: message dialog with Stay and Leave buttons. </para></listitem> < /itemizedlist>

It is possible to handle the script dialog request asynchronously, by simply caling @ref on the dialog argument and calling close when done. If the last reference is removed on a ScriptDialog and the dialog has not been closed, close will be called.

Parameters:

dialog

the ScriptDialog to show

Returns:

true to stop other handlers from being invoked for the event. false to propagate the event further.