Maluma Maluma - 1 month ago 14
Dart Question

Alert dialog from <webview> was blocked

Dart doesn't show the alert dialog when I use a webview and show this error:


: An alert dialog was blocked. (extensions::webViewEvents:225)

: A confirm dialog was blocked. (extensions::webViewEvents:225)


Does anyone know how to bypass the problem or how to catch the error?

Thanks.

Sorry for my bad English.

Edit

The code used:

Element webview= querySelector("#webview");
Map<String,String> map=new Map();
map["src"]=urlWebView;
webview.attributes.addAll(map);
webview.style.visibility="visible";



DartEditor version= STABLE build 45396

The version number of the SDK= 1.10.0


The webview loads a page that works on a js not created by me.

The error occurs when using this:

alert("***")

Xan Xan
Answer

A webview cannot show those by default.

You need to catch the dialog event, show your own UI for it (remember, Apps can't use alert and friends, so a <dialog> is a good option) and then pass the response back with DialogController

Comments