My MacOsX has a Cocoa app with a special controller/window that employs WebKit for browsing. I just found out that the browsed content may have links that should open new browser windows. Although I set the following two declarations (see below) for my webView – nothing happens when I click those links with my specialized window. Clicking them from a regular browser would re-open a window:
[[_webView preferences] setJavaScriptEnabled:YES];
[[_webView preferences] setJavaScriptCanOpenWindowsAutomatically:YES];
Am I missing a callback implementation?
Make yourself the UI delegate:
And implement
webView:createWebViewWithRequest:. This method needs to create and return the newWebViewobject and the window to display it. If you do not want to create the new view programmatically, you can use a NIB and load that instead.