Forum Xamarin.Mac


The Xamarin Forums have officially moved to the new Microsoft Q&A experience. Microsoft Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

To create new threads and ask questions head over to Microsoft Q&A for .NET and get involved today.

Having issues with RunJavaScriptConfirmPanel method inside WKUIDelegate class

Hi there,

I am new to Mac OSX development using Xamarin and am currently trying to build an app on Mac OSX using WKWebView to load a HTML on it.

Basically what is happening is, when a user clicks on a button we are trying to display a confirmation panel with Javascript (function inside the loaded HTML) asking them whether they want to proceed or not. We got everything working up until this part, however, when the user clicks on either of the "OK" or the "Cancel" button, the app freezes and I cannot click on anything.

I have already gone ahead and set the UIDelegate of the WKWebView.

What I currently have inside the WKUIDelegate class:

public override void RunJavaScriptConfirmPanel(WKWebView webView, string message, WKFrameInfo frame, Action completionHandler)
NSAlert alert = new NSAlert();
alert.InformativeText = "Are you sure you want to delete this item?";

Any help would be appreciated, thank you in advance.


  • ChrisHamonsChrisHamons USForum Administrator, Xamarin Team Xamurai

    I've never used that class, but there is an iOS sample that uses a similar API, which might be useful to look at.

Sign In or Register to comment.