Re: [OT?] Intercept Links in WebView
Re: [OT?] Intercept Links in WebView
- Subject: Re: [OT?] Intercept Links in WebView
- From: Conor Dearden <email@hidden>
- Date: Wed, 08 Mar 2006 13:25:17 +0100
> Is possible to intercept links from WebView with Cocoa/ObjC? Is there
> a delegate methods/event that contains the clicked url?
> Thanks
Set a policy delegate for the webview and use:
- (void)webView:(WebView *)sender
decidePolicyForNavigationAction:(NSDictionary *)actionInformation
request:(NSURLRequest *)request frame:(WebFrame *)frame
decisionListener:(id<WebPolicyDecisionListener>)listener
The URL is stored in the actionInformation object.
[actionInformation objectForKey:WebActionOriginalURLKey];
If you override the default action remember to say:
[listener ignore];
Conor
http://www.bruji.com/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden