Sunday, December 4, 2022
HomeiOS Developmentios - WKWebView Not Catch ButtonAction in navigationAction Delegate

ios – WKWebView Not Catch ButtonAction in navigationAction Delegate


Appears… right here we confronted a difficulty.., When a person clicks Button on WkWebview which isn’t Caught by…

func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping (WKNavigationActionPolicy) -> Void) {
                decisionHandler(.permit)
// -1 "different" seen when assigning the url programatically
// 0 "linkActivated" a hyperlink with an href attribute was tapped
// 3 "reload" web page was refreshed
                
 guard let urlAsString = navigationAction.request.url?.absoluteString else {
     return
  }
               
  if navigationAction.navigationType.rawValue == 0 {
     //***Obtain Logic right here... 
   }  
}

But it surely labored superb beforehand.

I attempt to catch the button by its ClassName by way of injecting js, returns a 0 worth. As a result of the WebView loadRequest response rendering in <iFrame>

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments