wiki.webvm.net/ webvm/ Cross-platform NPAPI notes

Platform compatibility list

See the WebVM test logs for up to date info.

NPAPI sanity test

npsimple tests scriptable object support on several platforms.

Browser versions

npapi versions in the wild

Get the NPObject for scripting the plugin. Introduced in Firefox 1.0 (NPAPI minor version 14).

 NPPVpluginScriptableNPObject  = 15,

In FF3 (gecko 1.9) modules/plugin/base/public/npapi.h has a minor of 19, which has a PluginThreadAsyncCall that’s of interest to WebVM.

The latest SDK can be found with the xulrunner nightlies.

In WebVM’s config.mk double check to ensure which version of NPAPI you’re using…

xulrunner-dev

Thanks to Mike Hommey & co. for the excellent packaging work.

x61:~% dpkg -L xulrunner-dev | grep npapi.h | xargs grep NPPVpluginScriptableNPObject
/usr/include/xulrunner-1.9/stable/npapi.h:  NPPVpluginScriptableNPObject  = 15,
/usr/include/xulrunner-1.9/unstable/npapi.h:  NPPVpluginScriptableNPObject  = 15,

WebVM uses the stable branch of xulrunner-dev

Gears

Gears seem to be using NPAPI minor 16 for Google Gears

won:508$ find . -iname npapi.h | xargs grep NP_VERSION_MINOR
./gecko_sdk/1.8/linux/include/npapi.h:#define NP_VERSION_MINOR 16
./gecko_sdk/1.8/osx/include/npapi.h:#define NP_VERSION_MINOR 16
./gecko_sdk/1.8/win32/include/npapi.h:#define NP_VERSION_MINOR 16

Lately however Google seem to be moving to MINOR 19:

/Users/hendry/aplix/google/gears/third_party/gecko_1.9/linux/gecko_sdk/include/npapi.h:#define NP_VERSION_MINOR 19
/Users/hendry/aplix/google/gears/third_party/gecko_1.9/osx/gecko_sdk/include/npapi.h:#define NP_VERSION_MINOR 19
/Users/hendry/aplix/google/gears/third_party/gecko_1.9/win32/gecko_sdk/include/npapi.h:#define NP_VERSION_MINOR 19

Mozilla’s gecko-sdk-i686-pc-linux-gnu.tar.gz

Code’s include

Asynchronous events

Gecko 1.9 tip of tree Firefox 3 beta has minor 19. This implements asynchronous events which is important to our plugin.

Darwin’s 10.4.10’s npapi.h

Under Darwin, NPAPI plugins seem to work different. See:

However:

Webkit’s tip-of-tree subversion

Ubuntu (gutsy)

The future of NPAPI

Is decided by plugin futures. Then these “standards” need to be implemented by browser vendors. For example enumeration in minor 18

Identification

Tracking differences with platforms and browsers, in the way the WebVM plugin identifies itself. The objective is to show subversion versioning numbers easily on deployments. The build page shows how the version numbers are inserted into the product.

Darwin (OS_DARWIN)

Opera & FF

opera:plugins - native plugin identification page

about:plugins - native plugin identification page for Firefox

Localized.r - an odd .REZ file (seems Darwin specific) that does not seem to be required by Safari.

resource 'STR#' (126) { {
    "WebVM plugin",
    "dev-jsx@aplix.co.jp Opera"
} };

This data is displayed on plugin listing.

Also with data from the function:

NPP_GetMIMEDescription

Seemingly not npjsx/darwin/Info.plist like Safari does.

Safari

Gets “WebVM Plug-In VER: 437M” for example from the npjsx/darwin/Info.plist WebPluginName key.

Uses the WebPluginDescription key in npjsx/darwin/Info.plist for description.

Uses the WebPluginMIMETypes key in npjsx/darwin/Info.plist for describing the mime type in native plugin listing.