WkWebView does not load links to pdfs

前端 未结 5 1219
情书的邮戳
情书的邮戳 2020-11-30 15:41

The WKWebView is not loading links. I am linking users to a privacy policy page, and the page has a group of links. The links are all pdfs hosted by wix. On safari and Chrom

5条回答
  •  星月不相逢
    2020-11-30 16:23

    One thing I can suggest (not sure if it will help, but too long for comment) is try to implement WKNavigationDelegate's decidePolicyFor:

    // WKNavigationDelegate
    func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping (WKNavigationActionPolicy) -> Void) {
        decisionHandler(.allow)
    }
    

    If it helps, then make that function more granular, i.e. which navigation you need to enable just for PDFs, not everything else in the world.

提交回复
热议问题