[webkit-dev] NPAPI plugin does not load under Safari (Cocoa related?)
ejpbruel at gmail.com
Mon Jun 22 07:55:22 PDT 2009
I am new on this list, so I hope this is the appropriate place for this kind
If not, please let me know where I should go, and I'll post any future
I've already sent the same question to one of the Mozilla mailinglists, so
take a look at the forward below (I hope posting forwards is considered a
---------- Forwarded message ----------
From: Eddy Bruël <ejpbruel at gmail.com>
Date: Mon, Jun 22, 2009 at 4:40 PM
Subject: Question about NSPrincipalClass
To: dev-tech-plugins at lists.mozilla.org
I've been trying to build a plugin that will work under OS X for both
Firefox and Safari.
To that end I've taken the BasicPlugin sample from the Mozilla source tree
works for both browsers) and have incrementally replaced the source files in
project with our own.
The resulting plugin works just fine under Firefox, but refuses to load in
Safari. I have
tried to debug the plugin, but it looks like the entry points are not even
After some searching I found a lead about having to include NPPrincipalClass
info.plist file, but this raises some questions with me.
First of all, even though a large part of our source tree is written in C++,
code is mainly just C. I only use Objective C in some very specific cases,
when I need to create a NSWindow. It looks like the NSPrincipalClass should
be set to
the name of the 'main' class in my plugin. I assume that I have to set
to an Objective C class. However, there is no Objective C class in my plugin
could qualify as the main class. There is such a class, but it is written in
I've tried setting the NSPrincipalClass to 'NSApplication', but this doesn't
Do I need to create an Objective C class which serves as the main
application class in
order to get the plugin to work under Safari? If so, how exactly? Some
would be greatly appreciated! However, it would be even better if there were
way to get the plugin to load in Safari, which does not involve me having to
substantial changes in our current plugin code.
Any bright ideas? I'm kind of stuck on this!
As an aside, am I correct to assume that adding Objective C / Cocoa based
code to my
plugin causes the NSPrincipalClass setting to become necessary? The reason I
that the original plugin, which uses only C code, *does* seem to work under
what am I overlooking/doing wrong here?
Any help would be greatly appreciated!
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the webkit-dev