UIWebView: Can I disable the javascript alert() inside any web page?

前端 未结 4 1989
情深已故
情深已故 2020-12-14 19:27

I am using UIWebView to load a URL.

Inside the page of that URL, it uses alert(\"whatever msg\") as JavaScript. My UIWebView w

4条回答
  •  孤城傲影
    2020-12-14 19:40

    Add this after your web view has loaded its content

    [MyWebView stringByEvaluatingJavaScriptFromString:@"window.alert=null;"];
    

提交回复
热议问题