One Logo Pool Ball
WebKit · IOS API REFERENCE

WebPage.DialogPresenting

protocol · iOS 26.0+ · SDK 27.1

protocol DialogPresenting

Allows providing custom behavior to handle JavaScript actions and provide a response. Typically when handling these, some UI should be presented to the user for them to provide a response, which will then be communicated back to JavaScript. When these methods are invoked, JavaScript is blocked until the async method returns.

Members (4)

method · iOS 26.0+

handleFileInputPrompt

Swift declaration
@MainActor func handleFileInputPrompt(parameters: WKOpenPanelParameters, initiatedBy frame: WebPage.FrameInfo) async -> WebPage.FileInputPromptResult

By default, this method immediately returns with a result of `.cancel`.

method · iOS 26.0+

handleJavaScriptAlert

Swift declaration
@MainActor func handleJavaScriptAlert(message: String, initiatedBy frame: WebPage.FrameInfo) async

By default, this method immediately returns.

method · iOS 26.0+

handleJavaScriptPrompt

Swift declaration
@MainActor func handleJavaScriptPrompt(message: String, defaultText: String?, initiatedBy frame: WebPage.FrameInfo) async -> WebPage.JavaScriptPromptResult

By default, this method immediately returns with a result of `.cancel`.

method · iOS 26.0+

handleJavaScriptConfirm

Swift declaration
@MainActor func handleJavaScriptConfirm(message: String, initiatedBy frame: WebPage.FrameInfo) async -> WebPage.JavaScriptConfirmResult

By default, this method immediately returns with a result of `.cancel`.

Skipped declarations

No declarations were skipped in this snapshot.

All WebKit types →