Pregunta

I write a plugin for android browser and follow the npruntime rule to let it support JavaScript method. However, after I call the function of my plugin in JavaScript, I get different identifier number in NPAPI's pluginHasMethod() function. I am sure there is no typo error in my JavaScript code. Is there any idea to debug this situation?

Thanks in advance.

¿Fue útil?

Solución

NPN_UTF8fromIdentifier is a function you have to provide yourself to call the correct function on the NPNFuncs that you were given when the plugin initialized.

The NPIdentifier is only guaranteed to be the same during the same browser instance; if you quit the browser and start a new one, it may change.

All NPN_* functions are not real functions; those are the "typical" names that you might use for them, but in actuality you are given a structure of function pointers of type NPNFuncs that will have a function pointer for each of the NPN_* functions; if you want those to actually work you need to create the NPN_UTF8FromIdentifier function, etc, and have it call the correct function pointer.

For more info see http://npapi.com/tutorial and http://npapi.com/tutorial2

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top