WebView2Feedback icon indicating copy to clipboard operation
WebView2Feedback copied to clipboard

to check if there is dialog opening or add dialog closed event

Open chenggj opened this issue 2 years ago • 3 comments

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.

AB#39554287

chenggj avatar May 13 '22 02:05 chenggj

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();
}

hbl917070 avatar May 13 '22 14:05 hbl917070

Thanks for the feedback! We've added this as a scenario on our backlog!

victorthoang avatar May 13 '22 18:05 victorthoang

Hi @chenggj, did the workaround mentioned above work for you?

nishitha-burman avatar May 17 '23 20:05 nishitha-burman