简体   繁体   中英

Executing native code in the browser

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM