Bug 15775
Summary: | NPAPI behavioural differences with Safari | ||
---|---|---|---|
Product: | WebKit | Reporter: | Kai Hendry <hendry> |
Component: | Plug-ins | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED INVALID | ||
Severity: | Minor | CC: | andersca, emacemac7, mrowe |
Priority: | P2 | Keywords: | InRadar |
Version: | 523.x (Safari 3) | ||
Hardware: | Mac | ||
OS: | OS X 10.4 |
Kai Hendry
Safari seems to enter the plugin on NP_Initialize, whilst Opera&Firefox enter on a main function like:
int main(NPNetscapeFuncs *pFuncs, NPPluginFuncs *pluginFuncs, NPP_ShutdownProcPtr *shutdown)
This behavior only seems to happen on Darwin, as Opera&Firefox seem to enter on NP_Initialize on Linux/Win32. So perhaps this isn't a bug and Opera&Firefox Darwin plugin support needs updating.
The Netscape Plugin Example /Developer/Examples/WebKit/NetscapeMoviePlugIn/ seems to imply that the _main function_ entry point is for old CFM legacy type stuff. That's misleading. Don't waste time ripping it out and find Opera&Firefox stop working.
Also Localized.r seems to be required for Opera&Firefox and not Safari. Very odd. I found this reference:
http://developer.mozilla.org/en/docs/Gecko_Plugin_API_Reference:Plug-in_Development_Overview#Mac_OS_X
It would be nice if Opera&WebKit&Firefox were more in sync when it comes to plugin registration.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Mark Rowe (bdash)
The issue with the example code needs to be tracked through Radar. I see that you filed <rdar://problem/5570872> on that issue, which is great. This bugzilla entry can focus specifically on the behavioural difference between WebKit and Firefox/Opera when loading NPAPI plugins. Specifically, the problem is that "main" is not called by WebKit on a mach-o plugin while Firefox/Opera require it to be present for the plugin to be used in a page. This can be reproduced by doing modifying the NetscapeMoviePlugin sample code to remove the two references to "int main(...)". You can also verify with a debugger that "main" is invoked by both Firefox and Opera as part of the plugin initialization for mach-o plugins, not only for CFM binaries as WebKit currently does.
Mark Rowe (bdash)
<rdar://problem/5573222>
Anders Carlsson
We've removed this example code.