开发者

My NPAPI plugin gets installed but I cannot call a method from it

I have embeded a simple NPAPI plugin in a Google chrome extension.It gets installed on Google Chrome (it is shown in about:plugins) but the background html page shows "missing plugin" and when a method is called (say plugin.foo), it shows a message saying "the plugin does not have the method foo"

My invoke call looks something like this

static bool
invoke(NPObject* obj, NPIdentifier methodName, const NPVariant *args, uint32_t argCount, NPVariant *result) {
    logmsg("invoke");
    int erro开发者_JAVA百科r = 1;
    char *name = npnfuncs->utf8fromidentifier(methodName);
    if(name) {
        if(!strcmp(name, "foo")) {
                    ...
                 ....

            return invokeDefault(obj, args, argCount, result);
        } 
    }
    // aim exception handling
    npnfuncs->setexception(obj, "exception during invocation");
    return false;
}

https://developer.mozilla.org/en/XEmbed_Extension_for_Mozilla_Plugins

according to this documentation, i have modified my NP_GetValue function and the plugin does not have NPP_SetWindow since i didnt want it to be a windowed plugin.

Am I going wrong somewhere? Also point out any other places that may have a scope of error.

Thank you Regards


"Missing plugin" can show either if the plugin isn't loaded (e.g., you typo'd the MIME type in the object tag), or if the plugin crashes during initialization.

Have you tried running with --plugin-startup-dialog to see if your plugin is actually instantiated, and if so debug it?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜