Re: plugin that does not force rendering in a new NSView
Re: plugin that does not force rendering in a new NSView
- Subject: Re: plugin that does not force rendering in a new NSView
- From: Andrew Harrison <email@hidden>
- Date: Mon, 14 Jan 2008 09:35:10 +0000
Hi,
On 13.01.2008, at 16:11, Andrew Harrison wrote:
I've created a plugin based on WebView for handling a particular
mime type. This works fine except, I do not want to render anything
in the browser - I just want to pass the url of the data to an
external application, i.e. I would like the user to click on a
link, and the external app to do its thing. Instead, because I'm
subclassing NSView, the browser moves to a blank page (because I
have nothing to render). Is there anyway to use the facilities of
the WebKit without forcing me to render something?
I think you don't need a WebKit plugin for that. From what I heard,
you can just specify the URL scheme you want to handle in your app's
Info.plist, and then it will be called upon automatically whenever
URLs with that particular scheme are encountered.
Thanks very much for your response. Indeed, I wrote an app using a
custom URL scheme and adding the properties to the info.plist. It
works great. But custom URL schemes should only be used if existing
URL schemes do not satisfy: http://www.w3.org/TR/webarch/#URI-scheme
HTTP is fine for my purposes. Hence I'm basing locating a local app on
mime type. You can register mime and file extensions in the info.plist
as well, but Safari won't open the app by default.
I found a very similar question on the list from over 2(!) years ago: http://lists.apple.com/archives/webkitsdk-dev/2005/Apr/msg00011.html
Unfortunately the thread fizzled out without a solution.
I would settle for either for the good option - not opening the NSView
and staying on the site where the user clicked - or the less good
option - going back to where the user clicked. The former may be
achievable with some cocoa magic. If I could get hold of the WebView
containing the previous content on plugin initialization, I might be
in with a chance as I could return this object to the system. But I
can't see how to get hold of another WebView from a WebView. The
latter is tricky because getting hold of the browser's history seems
almost impossible from Javascript. For example, Safari seems to create
a frameset for plugin content. The frame that my content loads into
contains a source attribute pointing to the url I'm after, but I can't
get hold of it using usual Javascript techniques.
Thanks,
Andrew
_______________________________________________
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