Contents

webView(_:runBeforeUnloadConfirmPanelWithMessage:initiatedBy:)

Displays a confirmation panel containing the specified message before a window closes.

Declaration

optional func webView(_ sender: WebView!, runBeforeUnloadConfirmPanelWithMessage message: String!, initiatedBy frame: WebFrame!) -> Bool

Parameters

  • sender:

    The web view that sent the message.

  • message:

    The message to display in the panel.

  • frame:

    The web frame whose JavaScript initiated this call.

Return Value

true if the user clicked the OK button; otherwise, false.

Discussion

Use this method to include a message in the confirmation panel in addition to the message supplied by the webpage. The confirmation panel should contain OK and Cancel buttons.

See Also

Opening Panels