WebView2Feedback
WebView2Feedback copied to clipboard
to check if there is dialog opening or add dialog closed event
I have a function that want to show alert dialog to user, but if there is a dialog show, we want to show another, now we can know the dialog has ScriptDialogOpening event, but no close event. so we don't know the status of dialog when show the dialog second time.
Sorry for my bad English, hope you understand my description.
javascript allows overriding alert()
, you can create a ScriptDialogClosing()
in C# to give js calls.
var _alert = alert;
alert = () => {
console.log("start");
_alert();
console.log("end");
window.chrome.webview.hostObjects.ScriptDialogClosing();
}
Thanks for the feedback! We've added this as a scenario on our backlog!
Hi @chenggj, did the workaround mentioned above work for you?