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.
It shows this effect, but when loading the url : Tryit Editor v3.6
pavi2410
(Pavitra Golchha)
#2
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.
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.
vknow360
(Sunny Gupta)
#8
Try using ‘CustomWebView’ extension and dismiss js alert in ‘OnJsAlert’ event.
1 Like
Thanks. Hope it solves my issue.
vknow360
(Sunny Gupta)
#10
Welcome
Sounds good.
Now what about sharing solution with us.
1 Like
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