2

I have a library written in C++ which works with raw HID input (mice, touchpads, etc.).

I would like to create an extension, plugin, Java applet or whatever (preferably for Google Chrome), which would allow me to use the library in the browser on the client-side. But I do not have previous experience and I am not sure how to do it and what to learn to achieve that.

I read that NPAPI support will be removed from Google Chrome.

Please tell me how can I do that?

What I have:

  1. The library itself (for Mac OS, Windows and Linux)

  2. The bindings Java, Python and Node.js

I was thinking of making use of the Node bindings in order to use the library in the browser.

Alisher
  • 59
  • 6
  • Also, not "will be removed", but "has been removed". Google Chrome 45 was released yesterday which has no NPAPI support – taxilian Sep 02 '15 at 15:20

1 Answers1

2

Native Client might work, but likely not unless what you need is accessible via native client APIs; you don't have full access to the system with Native Client.

Native Messaging may be a better fit, since you could actually write it using python or node.js if you want to (though it will require python or node to be installed to use it).

https://developer.chrome.com/native-messaging

FireBreath2 (still in sparsely documented beta) supports native messaging.

taxilian
  • 14,229
  • 4
  • 34
  • 73
  • Native Client seems to be no longer available in Chrome, but there are still [several emulators in JavaScript](https://softwarerecs.stackexchange.com/questions/25162/x86-emulator-in-javascript-to-run-linux-windows-or-dos) that can run native x86 binaries. – Anderson Green Feb 01 '22 at 23:49
  • It's true that native client has been removed since I wrote this answer, but at this point a better option than using some kind of emulator is to use emscripten to build your library as a WASM binary and use that -- it's supported by most modern browsers and performs nearly as well as pnacl did. – taxilian Feb 02 '22 at 22:42