How do I enable clicking on links in my mac osx webview?
I have the following code but I don’t know what methods to implement for the policy delegate…
@synthesize myWebView = _myWebView;
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
/* webview setup here, everything works fine
except cannot click links in webview..... */
//setup my delegate
_myWebView.policyDelegate = self;
}
//Now what?....
Thanks.
WebView doesn’t have restriction on links.
But if you need a custom behavior when clicking on a link in your web view, you should implement “webView:decidePolicyForNavigationAction:request:frame:decisionListener:” in your policy delegate. Then you you get the action type from the action information dictionary and you do your custom behavior if it’s a link clicked event.
Example: