Search code examples
google-chromepluginsnpapigoogle-nativeclientppapi

Make a NPAPI plugin(made for firefox) run into chrome browser


I have a NPAPI plugin , running fine in firefox. Now i want to port it to chrome browser, means i want it to work in chrome also. But i have learnt after browsing on internet and many links that chrome no longer supports NPAPI rather now it supports pepper API and now there is concept of native client.

What i have developed an understanding so far is that if i replace the NPAPI code(made for plugin for firefox) with the Pepper API code and upon compilation, a pexe file(native client module) along with manifest file(which is referring to the location of the pexe file) would be generated which would be kept on the server. when an html page having embed tag describing a particular MIME type, say "application/x-pnacl" is loaded, then via src attribute(referring to the manifest file) of embed tag, manifest file is fetched which then fetches the actual pexe file which is then run by/within the native client plugin(already present in chrome).

I am not sure whether this understanding is correct or not. I was assuming that just like firefox plugin, pexe file would be stored and installed on local user PC and then detected/loaded by chrome as a plugin. Please tell whether this is correct or not.

Also, I want to ask whether still there exist any way to run NPAPI plugin in chrome or not. If it is please tell otherwise i should not think about it.


Solution

  • First, Chrome no longer supports NPAPI plugins for security reasons: https://support.google.com/chrome/answer/6213033?hl=en

    Plugins must use the Pepper Plugin API (PPAPI) and be compiled as Native Client (NaCl) executables so the plugin binary can be validated as safe to run. Portable Native Client (PNaCl) plugins can be loaded by any web page without the user installing anything. However, if your plugin is large, you may want to distribute it as a Web Application through the Chrome Web Store. In that case, you can bundle your .nexe's or a .pexe with your application so it is effectively installed on the user's machine.

    This link describes how you can distribute your plugin: https://developer.chrome.com/native-client/devguide/distributing