windowsgoogle-chromepluginsgoogle-nativeclientppapi

Chrome PPAPI plugin to execute commands on windows system


We were previously using a NPAPI plugin to execute some commands on windows system from our website. Now that NPAPI is gone, we are trying to port things to PPAPI or NaCl but there seems to be a lot of issues.

  1. Google seems to provide vs_addin for Visual Studio 2010 and Visual Studio 2012, but it always give error when trying to compile the code as Pepper Plugin during linking phase. The error is something related to _MSC_VER mismatch as the object files in PPAPI libraries seems to be having that version as 1800 where the value is supposed to be 1600 or 1700 for VS2010 and VS2012 respectively.
  2. To get around this issue, we tried downloading a old copy of pepper, but its not available from SDK. somehow we found the pepper_25 version on the internet, but then it seems that postmessage function is not available for plugins.
  3. Tried using scriptableobjects but looks like the support for them was actually removed long back sometime in chrome 13?
  4. If we are trying to build it as NaCl plugin, then we don't get access to windows functions like ShellExecuteA as the corresponding libraries are not included. Trying to include libraries only results into more errors.
  5. This might be possible by having an extension with native messaging, but again a website cannot directly interact with an extension unless the extension places a content script on the webpage. As the users of the website, can install the website on their own systems, we have to scan and add content script on all the web pages which doesn't seem to be a nice option as it can result into system slowdown.

TLDR:

Now the question is, how can we build a chrome plugin that can execute commands on windows?

Thanks & Regards


Solution

  • The short answer is, there is (by design) no way to distribute a plugin that has access to the native platform APIs. The VS addin has a way to compile one, but it will only run on your local machine. You can develop a NaCl or PNaCl plugin, but it is limited to NaCl's APIs plus Javascript. If you need native APIs, then you might want to look at native messaging.