在Chrome浏览器的Firefox本地客户端消息传递中使用类似技术? [英] Similar technology to Chrome's Native Client Messaging in Firefox?

查看:203
本文介绍了在Chrome浏览器的Firefox本地客户端消息传递中使用类似技术?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们想在基于浏览器的Web应用程序和客户端守护进程之间替换一个自定义的NPAPI接口。

是否有类似于Chrome的Native Client Messaging的技术Firefox?

解决方案

js-ctypes [1]可能是Mozilla最接近的替代方案。 b $ b

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



我有一个C ++模块,可以编译为本地消息的二进制可执行文件或js-ctypes的库。两者之间的区别主要在于本地消息传递调用二进制可执行文件并执行stdin / stdout数据交换,js-ctypes打开静态/共享库(通过dlopen)并调用库的公开方法,可以返回兼容的数据类型[2],还可以选择调用传递的JavaScript回调方法。



[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


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?

解决方案

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

这篇关于在Chrome浏览器的Firefox本地客户端消息传递中使用类似技术?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆