Skip to content
This repository has been archived by the owner on Oct 10, 2024. It is now read-only.

Handle JavaScript alert() and confirm() by default #62

Closed
wants to merge 2 commits into from

Conversation

joemasilotti
Copy link
Owner

@joemasilotti joemasilotti commented Oct 15, 2023

This PR builds on the idea from #61, baking in default behavior for JavaScript alert() and confirm() dialogs.

I'm in favor of having this live in Turbo Navigator / turbo-ios. Especially because a developer can implement the delegate callbacks to customize the behavior entirely.

But it requires the TurboNavigator class to become the UI delegate of the web view. Which means we close off all the other methods in WKUIDelegate. I don't want to expose every single one of these with a default (empty) implementation. But I'm not sure of a more elegant way to handle it.

Artboard

Helpful when completely custom navigation is required, like presenting a
modal from:

```
WKUIDelegate.webView(_:runJavaScriptConfirmPanelWithMessage:initiatedByFrame:completionHandler:)
```
@joemasilotti
Copy link
Owner Author

Closed in favor of #74.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant