Re: Getting started with WebKit plugins
Re: Getting started with WebKit plugins
- Subject: Re: Getting started with WebKit plugins
- From: Severin Kurpiers <email@hidden>
- Date: Tue, 10 Jan 2006 11:15:51 +0100
Hi Christopher,
the documentation "Web Kit Plug-in Programming Topics" isn't bad.
Believe me, you will find most necessary information there.
Here some thoughts that, I hope, will let you see this from a
different perspective: a Web Kit plugin is a bundle with the
extension "plugin". Its Info.plist requires the following entries:
1. CFBundlePackageType has to be set to WBPL
2. NSPrincipalClass has to be set to your NSView subclass
3. WebPluginDescription (description)
4. WebPluginMIMETypes (dictionary; see documentation for explanation)
5. WebPluginName - name of your plug-in
A plug-in is in fact an instance (a subclass) of NSView that needs to
conform to the WebPlugIn informal protocol. Since it is just a
subclass of NSView and not an application, it doesn't have the main-
function, and in many cases there wont be necessary to include a nib
file.
I hope you've got the idea.
Bye,
Severin Kurpiers
Verek Ltd.
On 10. Jan 2006, at 09:59, email@hidden wrote:
Message: 8
Date: Mon, 9 Jan 2006 20:03:32 -0800
From: Christopher Drum <email@hidden>
Subject: Getting started with WebKit plugins
To: email@hidden
Message-ID: <email@hidden>
Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed
So I'm going through the Apple docs about making WebKit plugins, and
I'm lost. The documentation in "Web Kit Plug-In Programming Topics"
feels anemic, with many glaring omissions. For example, in going
through the "PlugInMovieView" example project file, it seems to have
not started it's life as a Cocoa Application. It contains no .nib
file and no main.m (as I would expect, I think...). The documentation
gives no indication on how to start a WebKit plugin project, nor is
there an Xcode template to begin one (a major glaring omission,
methinks).
Additional, using the inspector on the target for the example project
shows settings that would not be immediately obvious to a newbie
plugin developer, yet the documentation makes no mention of having
changed some of these things. Nor does the example project explain
the alternations made to the Info.plist file for registering MIME
types.
Anyway, all of this leads to the basic question of: How does one
start and end a plugin project? Once started, I get the gist of the
matter, and I've successfully gotten Javascript to talk to Objective-
C and back again through an embedded WebView in a sample Cocoa app.
So, that part of the coding I get (for now). After the coding is
done, what steps need to be taken to ensure the project builds out
properly into the correct filetype. Is a plugin simply a Cocoa
application that ends in ".plugin", or is it something more than that?
When Safari browses a website that needs access to my new plugin,
does the HTML for the webpage have to ask for something specific of
the webpage, or can (for example) the Javascript in the webpage
simply assume access to the plugin's methods are already available?
In my test app, I simply dragged a WebView into my .nib file, had it
load a sample .html file off my desktop and it immediately started
using my Cocoa methods through Javascript. Will .html files in
Safari, using my custom plugin, function likewise or does I need to
modify the .html file in some way to let it know about the plugin's
existence?
Thanks in advance for any help anyone can offer on this matter.
Christopher Drum
http://homepage.mac.com/christopherdrum
_______________________________________________
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