Disabling visible links in UIWebView

前端 未结 3 1654
醉酒成梦
醉酒成梦 2021-01-22 21:31

I have a number of web views in my app in which I need to be careful about allowing further HTML links.

I disallow links in the delegate method shouldStartLoadWithRequ

3条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-22 22:07

    Try injecting Javascript into the UIWebView to change the appearance of the links.

    Removing the href from all anchors should clear the formatting.

    Here's some Javascript to get you started if you need it:

    for(a in document.getElementsByTagName("a")) { a.href= ""; }
    

提交回复
热议问题