---
title: "webView(_:runJavaScriptConfirmPanelWithMessage:initiatedBy:)"
framework: webkit
role: symbol
role_heading: Instance Method
path: "webkit/webuidelegate/webview(_:runjavascriptconfirmpanelwithmessage:initiatedby:)"
---

# webView(_:runJavaScriptConfirmPanelWithMessage:initiatedBy:)

Displays a JavaScript confirmation panel with the specified message.

## Declaration

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

## Parameters

- `sender`: The web view that sent the message.
- `message`: The message to display in the confirmation panel.
- `frame`: The web frame whose JavaScript initiated this call.

## Return Value

Return Value true if the user clicks OK; otherwise, false.

## Discussion

Discussion This method displays a confirmation panel when JavaScript code calls confirm. Delegates should visually indicate that this panel comes from JavaScript. The panel should contain an OK and a Cancel button. No action is taken if you do not implement this method.

## See Also

### Opening Panels

- [webView(_:runJavaScriptAlertPanelWithMessage:initiatedBy:)](webkit/webuidelegate/webview(_:runjavascriptalertpanelwithmessage:initiatedby:).md)
- [webView(_:runJavaScriptTextInputPanelWithPrompt:defaultText:initiatedBy:)](webkit/webuidelegate/webview(_:runjavascripttextinputpanelwithprompt:defaulttext:initiatedby:).md)
- [webView(_:runOpenPanelForFileButtonWith:)](webkit/webuidelegate/webview(_:runopenpanelforfilebuttonwith:).md)
- [webView(_:runOpenPanelForFileButtonWith:allowMultipleFiles:)](webkit/webuidelegate/webview(_:runopenpanelforfilebuttonwith:allowmultiplefiles:).md)
- [webView(_:runBeforeUnloadConfirmPanelWithMessage:initiatedBy:)](webkit/webuidelegate/webview(_:runbeforeunloadconfirmpanelwithmessage:initiatedby:).md)
