Bug 15775 - NPAPI behavioural differences with Safari
Summary: NPAPI behavioural differences with Safari
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: Plug-ins (show other bugs)
Version: 523.x (Safari 3)
Hardware: Mac OS X 10.4
: P2 Minor
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2007-10-31 09:14 PDT by Kai Hendry
Modified: 2014-04-19 13:36 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kai Hendry 2007-10-31 09:14:18 PDT
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.
Comment 1 Mark Rowe (bdash) 2007-11-01 03:13:19 PDT
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.
Comment 2 Mark Rowe (bdash) 2007-11-01 03:14:35 PDT
<rdar://problem/5573222>
Comment 3 Anders Carlsson 2014-04-19 13:36:22 PDT
We've removed this example code.