Re: How can I get valid request object from webView:createWebViewWithRequest:?
Re: How can I get valid request object from webView:createWebViewWithRequest:?
- Subject: Re: How can I get valid request object from webView:createWebViewWithRequest:?
- From: Hiroshi Saito <email@hidden>
- Date: Fri, 16 Jul 2004 21:40:46 +0900
Hi,
Still I have no idea to solve this problem.
For convenience, I put an archive of Xcode project which can reproduce
this problem.
http://www.hiemalis.org/~gecko/pub/linktoblank.zip
1. build and run it.
2. Drag and Drop html/hello.html into a WebView.
3A. crick _new or _blank
or
3B. right click, and select "Open Link to New Window"
then, see console log or "Run" window of Xcode.
output of 3A:
2004-07-16 21:28:04.137 linktoblank[1669] webView: <WebView: 0x347870>
createWebViewWithRequest: (null)
output of 3B:
2004-07-16 21:28:22.564 linktoblank[1669] webView: <WebView: 0x347870>
createWebViewWithRequest: <NSURLRequest
file:///Users/saito/Desktop/linktoblank/html/bye.html>
Thanks.
Hiroshi
On Jul 13, 2004, at 20:05, Hiroshi Saito wrote:
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.
_______________________________________________
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.