何が間違っているのですか?Webサイトのアラートメッセージを取得する方法UWP WebView
私はテストのためにw3schools.comを使用しました。
webView.Navigate(new Uri("https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_alert"));
Package.appxmanifestファイル
NavigationCompleted
private async void webView_NavigationCompleted(WebView sender, WebViewNavigationCompletedEventArgs args)
{
string result = await sender.InvokeScriptAsync("eval", new string[] { "window.alert = function (AlertMessage) {window.external.notify(AlertMessage)}" });
}
ScriptNotify
private async void WebView_ScriptNotify(object sender, NotifyEventArgs e)
{
MessageDialog dialog = new MessageDialog(e.Value);
await dialog.ShowAsync();
}
あなたが起こることを期待し何をすべきか、そして、それは代わりに何をしているのですか? – Adam
私は警告メッセージ([スクリーンショット]のような)を取得したいです(https://i.stack.imgur.com/IHbud.png) –