Vivek Goel
Vivek Goel

Reputation: 24160

How to give NPAPI plugin version on linux?

Here http://gplflash.sourceforge.net/gplflash2_blog/npapi.html

Given code is

switch(var)
    {
        case NPPVpluginNameString:
            *val = "Example Plug-In";
            break;
        case NPPVpluginDescriptionString:
            *val = "A plug-in that demonstrates how NP_GetVal is implemented";
            break;
        default:
            ret = NPERR_INVALID_PARAM;
            break;
    }

But it does not take care about version. How can I specify version in NPAPI plugin ?

Upvotes: 2

Views: 482

Answers (1)

taxilian
taxilian

Reputation: 14324

NPP_GetValue is only used for getting the plugin name and description; in order to get the mimetype and version there are extra entrypoints on linux.

FireBreath uses this code: https://github.com/firebreath/FireBreath/blob/master/src/PluginAuto/X11/np_x11main.cpp#L24

The mozilla docs have the following not-so-helpful docs: https://developer.mozilla.org/Talk:en/Gecko_Plugin_API_Reference/Plug-in_Side_Plug-in_API

The entrypoint for plugin version on linux seems to be:

extern "C" char * NP_GetPluginVersion()
{
    return "1.0.0.75";
}

I'm not 100% certain if this works the same way on all browsers; you could always throw together a quick project in FireBreath and do some testing to see what version is reported by various browsers.

Upvotes: 2

Related Questions