I am blindly guessing since I only have a Windows computer. After reading the Apple Developer documentation, we have gathered information that may lead to some ideas on how to resolve the issue.
Based on WKWebView ,
Set the delegate property to an object that conforms to the WKUIDelegate protocol to track the loading of web content.
Also, I see that we can set navigationDelegate
with
weak var navigationDelegate: WKNavigationDelegate? { get set }
The WKNavigationDelegate protocol methods help implement custom behaviors that run during the web view when accepting, loading, and completing a navigation request.
Then, after creating and installing our WKNavigationDelegate , we will override some methods to intercept something we can look for. I found the "Response to server actions" section, as they receive WKNavigation as a parameter. Moreover, you can skip WKNavigationAction and WKNavigationResponse to see if there is anything that can help us achieve our goal.
By the way, I just give some ideas about what to try so that we can solve this issue, ideas that may be 100% wrong, because I have not tried them myself.
source share