Firefox 上的 JS-Ctypes OS

JS-Ctypes on Firefox OS

我很久以前就在 Firefox OS 应用程序上使用过 js-ctypes,但我现在似乎无法使用它。我什至不能使用 Components,js-ctypes 是否被 FxOS 应用程序禁止?

我们正在努力实现标准化的Components object you're referring to is only available to Firefox Add-ons or Gecko/XUL. Apps on Firefox OS are 100% HTML5, CSS3, and ECMAScript5. The only additional APIs are lower level hardware access

如果您希望在浏览器中使用 C 或 C++ 代码,首选方法是使用 Emscripten 将其交叉编译为 JS。 Emscripten 确实有其局限性,这取决于您要做什么。

如果您只是尝试使用类型化数组支持的数据,将来我们将有 Typed Objects in ES7, which more usable than the current story