UIWebView delegate method shouldStartLoadWithRequest: equivalent in WKWebView?

前端 未结 7 828
忘掉有多难
忘掉有多难 2020-12-12 14:37

I have a module inside my iOS 7+ app which is a UIWebView. The html page loads a javascript that creates custom-shaped buttons (using the Raphaeljs library). With UIWebView,

7条回答
  •  囚心锁ツ
    2020-12-12 15:08

    To answer the original question, the equivalent of webView:shouldStartLoadWithRequest:navigationType: in UIWebView is webView:decidePolicyForNavigationAction:decisionHandler: in WKWebView. These methods are called before each request is made (including the initial request) and provide the ability to allow/disallow it.

提交回复
热议问题