Thread-topic: Opening links in new windows in Carbon?
> > - (WebView *)webView:(WebView *)sender
createWebViewWithRequest:(NSURLRequest *)request
> > {
> > LSOpenCFURL((CFURLRef) [request URL], NULL);
> > return nil;
> > }
> >
> > Is this a reasonable way to do it? It does appear to work.
>
> That seems OK. But the "policy delegate" is normally the way someone
> would do something like what you describe.
So how would this be done with the WebPolicyDelegate protocol? I
implemented my own (do-nothing for now, but breakpointable) version of
webView:decidePolicyForNewWindowAction:request:newFrameName:decisionList
ener
and sent the setPolicyDelegate message to my WebView, then fired up the
app and selected "Open Link in New Window" on some link, but the method
is never called.
And back to webView:createWebViewWithRequest for a second -- I see that
not only does
it get called when one selects "Open Link in New Window", but it also
gets
called when Javascript's window.open(someUrl) is called. However, in
that case,
the request passed in is nil. So if one wanted to open that someUrl in
an
external browser, how do you get it?
I realize this really is probably too involved (and basic) for this
list,
so I'd love to hear recommendations on what to read. I have read the
"Introduction to Web Kit Objective-C Programming Guide" and various
relevant
class references and they are fine, but they don't really put it all
together.
(Again, my goal is to start with something simple like SimpleCarbonWeb
and enable
it to be able to open links in new windows (ideally an external browser)
when
someone hits "Open Link in New Window", to have Javascript window.open()
calls
open new windows (again, ideally in an external browser), and to have
hitting
"Download Link" save what the link points to to a file.)
== Rich Carreiro
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webkitsdk-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webkitsdk-dev/email@hidden
This email sent to email@hidden