Я наконец понял это.
Установите делегата WebPolicyDelegate для вашего экземпляра WebView:
self.webview.policyDelegate = self;
Затем реализуйте метод – webView:decidePolicyForNavigationAction:request:frame:decisionListener:
в своем делегате:
-(void)webView:(WebView *)webView
decidePolicyForNavigationAction:(NSDictionary *)actionInformation
request:(NSURLRequest *)request
frame:(WebFrame *)frame
decisionListener:(id < WebPolicyDecisionListener >)listener
{
int actionKey = [[actionInformation objectForKey: WebActionNavigationTypeKey] intValue];
if (actionKey == WebNavigationTypeOther)
{
[listener use];
}
else
{
//
// Here is where you would intercept the user navigating away
// from the current page, and use `[listener ignore];`
//
NSLog(@"\n\nuser navigating from: \n\t%@\nto:\n\t%@",
[webView mainFrameURL],
[[request URL] absoluteString]);
[listener use];
}
}