2

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 ?

Vivek Goel
  • 22,942
  • 29
  • 114
  • 186

1 Answers1

2

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.

taxilian
  • 14,229
  • 4
  • 34
  • 73