It's not a very good comparison; NPAPI and Native Client is probably a better thing to compare. ActiveX only works on IE, NPAPi works on other browsers (including Chrome).
Native Client executes code that is compiled by a special compiler that prevents you from using certain types of operations and provides some sandboxing and such; it is intended to allow you to write native code but still enforce many of the security restrictions that the browser already follows. For things that are possible, it's great -- as long as you can get it to work in the browser you want to use. Currently it's supported by Google Chrome, but I haven't heard for sure that it works in any other browser.
Conversely, with NPAPI or ActiveX (and see FireBreath which allows you to target both types simultaneously) you write native code and do more or less anything that a normal application could do (except in IE on Vista/Win7 w/ UAC enabled where you are in low integrity mode).
The biggest disadvantage to NaCl is probably that you can't access hardware; since it's sandboxed, you're a bit more limited as to what networking things you can do and a lot more limited as to what devices you can interface with.
Native client provides a more secure environment for the native code to execute. Whereas ActiveX lets the native code run with full priviliges of the user.
发布评论
评论(2)
这不是一个很好的比较; NPAPI 和 Native Client 可能是更好的比较。 ActiveX仅适用于IE,NPAPi适用于其他浏览器(包括Chrome)。
Native Client 执行由特殊编译器编译的代码,该编译器会阻止您使用某些类型的操作并提供一些沙箱等;它的目的是允许您编写本机代码,但仍然强制执行浏览器已经遵循的许多安全限制。对于可能的事情来说,这很好——只要您可以让它在您想要使用的浏览器中运行即可。目前 Google Chrome 支持它,但我还没有听说它可以在任何其他浏览器中工作。
相反,使用 NPAPI 或 ActiveX(参见 FireBreath,它允许您同时针对两种类型),您可以编写本机代码并执行或多或少的任何操作一个普通的应用程序就可以做到(除了在 Vista/Win7 上的 IE 中,启用了 UAC,并且处于低完整性模式)。
NaCl 最大的缺点可能是你无法访问硬件;由于它是沙盒的,因此您可以执行的网络操作以及可以连接的设备都受到更多限制。
我强烈建议您阅读有关 NaCl 的常见问题解答:http://code.google.com/chrome/nativeclient/faq.html
对我来说,对于我需要插件的任何项目来说,NaCl 都不是一个可行的选择,原因很简单:似乎只有 Google Chrome 得到完全官方支持。
It's not a very good comparison; NPAPI and Native Client is probably a better thing to compare. ActiveX only works on IE, NPAPi works on other browsers (including Chrome).
Native Client executes code that is compiled by a special compiler that prevents you from using certain types of operations and provides some sandboxing and such; it is intended to allow you to write native code but still enforce many of the security restrictions that the browser already follows. For things that are possible, it's great -- as long as you can get it to work in the browser you want to use. Currently it's supported by Google Chrome, but I haven't heard for sure that it works in any other browser.
Conversely, with NPAPI or ActiveX (and see FireBreath which allows you to target both types simultaneously) you write native code and do more or less anything that a normal application could do (except in IE on Vista/Win7 w/ UAC enabled where you are in low integrity mode).
The biggest disadvantage to NaCl is probably that you can't access hardware; since it's sandboxed, you're a bit more limited as to what networking things you can do and a lot more limited as to what devices you can interface with.
I highly recommend reading the FAQ about NaCl: http://code.google.com/chrome/nativeclient/faq.html
To me, NaCl is not a viable option for any of my projects requiring a plugin for the simple reason that only Google Chrome seems to be completely and officially supported.
本机客户端为本机代码的执行提供了更安全的环境。而 ActiveX 允许本机代码以用户的完全权限运行。
Native client provides a more secure environment for the native code to execute. Whereas ActiveX lets the native code run with full priviliges of the user.