How to disable javascript onclick javascript alert in Webview?

How to disable javascript onclick javascript alert in Webview, I use a web viewer, every time I load it shows an alert which I don’t want to appear.

I have disabled javascript but it still shows the alert.

image

It shows this effect, but when loading the url : Tryit Editor v3.6

Run this code on every webpage using Evaluate JS block.

window.alert = function () { }
1 Like

How did you formatted your code like this ??

Hello
I don’t want to show alert in WebViewer component.
I searched community but couldn’t find any solution.

image

I tried the above method but it didn’t worked out.

What do you mean by block js ??

If I will disable JS, other functions in WebView won’t work.

Try using ‘CustomWebView’ extension and dismiss js alert in ‘OnJsAlert’ event.

1 Like

Thanks. Hope it solves my issue.

Welcome

Sounds good.
Now what about sharing solution with us.

1 Like

image
This block as stated by you.
Well I have not tried it because I found another solution.

<iframe sandbox=“allow-scripts allow-forms allow-pointer-lock allow-same-origin” src="…"></iframe>

I just wanted to disable alerts from my iframe tag and I solved it with the above html attribute.

1 Like