What are the differences between Microsoft's ActiveX and Google's Native Client? [closed]
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this questionMicrosoft's ActiveX and Google's Native Client both allow you to build web applications that execute native compiled code inside the browser. Besides the fact that they operate on diffe开发者_JAVA百科rent browsers and operating systems, what are the technical differences between them?
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.
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.
精彩评论