Click or drag to resize
CfxJsDialogHandler Class

[This is preliminary documentation and is subject to change.]

Implement this structure to handle events related to JavaScript dialogs. The functions of this structure will be called on the UI thread.
Inheritance Hierarchy
SystemObject
  ChromiumCfxObject
    ChromiumCfxBase
      ChromiumCfxClientBase
        ChromiumCfxJsDialogHandler

Namespace: Chromium
Assembly: ChromiumFX (in ChromiumFX.dll)
Syntax
public class CfxJsDialogHandler : CfxClientBase

The CfxJsDialogHandler type exposes the following members.

Constructors
  NameDescription
Public methodCfxJsDialogHandler
Initializes a new instance of the CfxJsDialogHandler class
Top
Properties
  NameDescription
Public propertyCallbacksDisabled
When true, all CEF callback events are disabled for this handler. Incoming callbacks will return default values to CEF.
(Inherited from CfxClientBase.)
Public propertyNativePtr
Provides access to the underlying native cef struct. This is a refcounted client struct derived from cef_base_t. Add a ref in order to keep it alive when this managed object go out of scope.
(Inherited from CfxClientBase.)
Top
Events
  NameDescription
Public eventOnBeforeUnloadDialog
Called to run a dialog asking the user if they want to leave a page. Return false (0) to use the default dialog implementation. Return true (1) if the application will use a custom dialog or if the callback has been executed immediately. Custom dialogs may be either modal or modeless. If a custom dialog is used the application must execute |Callback| once the custom dialog is dismissed.
Public eventOnDialogClosed
Called when the default implementation dialog is closed.
Public eventOnJsDialog
Called to run a JavaScript dialog. If |OriginUrl| is non-NULL it can be passed to the CfxFormatUrlForSecurityDisplay function to retrieve a secure and user-friendly display string. The |DefaultPromptText| value will be specified for prompt dialogs only. Set |SuppressMessage| to true (1) and return false (0) to suppress the message (suppressing messages is preferable to immediately executing the callback as this is used to detect presumably malicious behavior like spamming alert messages in onbeforeunload). Set |SuppressMessage| to false (0) and return false (0) to use the default implementation (the default implementation will show one modal dialog at a time and suppress any additional dialog requests until the displayed dialog is dismissed). Return true (1) if the application will use a custom dialog or if the callback has been executed immediately. Custom dialogs may be either modal or modeless. If a custom dialog is used the application must execute |Callback| once the custom dialog is dismissed.
Public eventOnResetDialogState
Called to cancel any pending dialogs and reset any saved dialog state. Will be called due to events like page navigation irregardless of whether any dialogs are currently pending.
Top
Remarks
See also the original CEF documentation in cef/include/capi/cef_jsdialog_handler_capi.h.
See Also