How can I get valid request object from webView:createWebViewWithRequest:?
How can I get valid request object from webView:createWebViewWithRequest:?
- Subject: How can I get valid request object from webView:createWebViewWithRequest:?
- From: Hiroshi Saito <email@hidden>
- Date: Tue, 13 Jul 2004 20:05:47 +0900
Hi list,
I use WebView for displaying html. When an anchor tag that target
attribute is
"_blank" is clicked, I want to open default browser.
To accomplish this aim, I tried to use webView:createWebViewWithRequest:
delegate method. But I can't get valid request argument from
webView:createWebViewWithRequest:.
To reproduce it, follow following steps:
1. create new "Cocoa Document-based Application" project.
2. add WebKit.framework into the project.
3. add WebView into the Window of MyDocument.nib.
4. make connection from WebView to File's Owner as UIDelegate.
5. implement webview:createWebViewWithRequest: and return nil
6. build and run, then drop a html file including a link;
"<a href="bar.html" target="_blank">bar</a>"
into the WebView.
7. click this link, and check a value of request argument of
webView:createWebViewWithRequest:.
You will get (null) as a value of 'request'.
If you select "Open Link in New Window" from right-click menu,
you will get valid 'request'.
How can I get valid request object from
webView:createWebViewWithRequest:?
Or How can I get url of "_blank" target?
== sample of webview:createWebViewWithRequest:
- (WebView *) webView:(WebView *)sender
createWebViewWithRequest:(NSURLRequest *)request
{
NSLog(@"webView: %@ createWebViewWithRequest: %@\n",
sender, request);
return nil;
}
== My environment
* Panther (v10.3.4)
* Xcode1.1
* Safari 1.2.2
Best Regards,
Hiroshi Saito
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.