Re: WebView in a modal panel - any new solutions?
Re: WebView in a modal panel - any new solutions?
- Subject: Re: WebView in a modal panel - any new solutions?
- From: Mike Abdullah <email@hidden>
- Date: Mon, 23 Nov 2009 23:38:32 +0000
WebKit is open source, so fire up your SVN client for release 4.0.3. In WebViewPrivate.h you will see this:
@interface WebView (WebPendingPublic)
- (void)scheduleInRunLoop:(NSRunLoop *)runLoop forMode:(NSString *)mode;
- (void)unscheduleFromRunLoop:(NSRunLoop *)runLoop forMode:(NSString *)mode;
@end
Which would seem to be exactly what you need. I think these in fact go back to version 3.1, but can't be bothered to check right now (4.0.3 is what I have checked out locally).
Your choices:
A) Use this API and make sure nothing will go drastically wrong should the WebKit team change the API before making it public
B) Ship a custom version of WebKit that you know has these methods with your app (although it sounds like in your case this probably isn't feasible)
Somebody will probably shout at me for mentioning "private" API, but WebKit is somewhat of a special case thanks to option B. Mind you, this sort of question probably would have been better on the WebKit list.
Mike.
On 18 Nov 2009, at 23:21, Leif Harrison wrote:
> Is anyone out there using WebViews in modal panels? If so, what are you doing to get around it's issues with NSURLConnection? (Presuming it's still an issue in Snow Leopard? Which it certainly seem like from what I've seen...)
>
> Our current solution is to use a custom subclass of NSURLConnection and poseAsClass, however this has two BIG issues with it. 1) poseAsClass is deprecated, and 2) this is being done in a plugin, which really makes me feel like we're being a "bad citizen" by replacing a class that might be used by the host application or by other plugins.
>
> The only other real option I've seen out there is to use beginModalSessionForWindow/runModalSession/endModalSession and execute the default runloop within the modal run loop.
> (http://www.dejal.com/blog/2007/01/cocoa-topics-case-modal-webview)
>
> Unfortunately, in our case we don't have control of the initial modal session setup (being a plugin) so that isn't a solution we can use.
>
> So...are there any other workable solutions out there? Alternatives to poseAsClass that can be undone? Solutions that use the WebView delegate methods? (I'm currently trying this, but we use a lot of interactive Javascript, so I haven't quite gotten it to work yet.) Other possibilities?
>
> Or is there some hope of WebView supporting modal sessions/panels sometime soon? (or some API I'm missing...?)
>
> - Leif
>
> ----------
> Leif Harrison
> Senior Engineer - Ubermind, Inc.
> email@hidden
> email@hidden
>
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden