Similar technology to Chrome's Native Client Messaging in Firefox?

廉价感情. 提交于 2019-12-03 03:53:48

问题


We want to replace a custom NPAPI interface between a browser based web application and an client side daemon process.

Is there a similar technology to Chrome's Native Client Messaging in Firefox?


回答1:


js-ctypes[1] is probably the closest alternative for Mozilla.

https://developer.mozilla.org/en-US/docs/Mozilla/js-ctypes

I have a C++ module that I compile as a binary executable for native-messaging or as a library for js-ctypes. The difference between the two is primarily that native-messaging calls a binary executable and performs stdin/stdout data exchange, and js-ctypes opens a static/shared library (via dlopen) and calls exposed methods of your library which can return compatible data types[2] and optionally call a passed JavaScript callback method.

[1] https://developer.mozilla.org/en-US/docs/Mozilla/js-ctypes

[2] https://developer.mozilla.org/en-US/docs/Mozilla/js-ctypes/js-ctypes_reference/ctypes#Predefined_data_types




回答2:


With new support for Mozilla 'Chrome' WebExtensions API seems like soon there will be a very similar technology to Chrome's Native Client Messaging.

At this time it's still on the 'List of APIs [mozilla] will likely support in the future'



来源:https://stackoverflow.com/questions/18990874/similar-technology-to-chromes-native-client-messaging-in-firefox

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!