Search code examples
google-chromepluginsgoogle-chrome-extensiongoogle-nativeclient

Google Chrome Native Client compared with plugin or extension


I am new to Native Client; and new to plugins/extensions too. It strikes me that plugins/extensions are "better" than NaCl in some respects:

  1. Can compile plugin/extension anywhere/anyhow to produce a plain old DLL or a .so; NaCL needs binary produced only by the NaCl toolchain.

  2. Plugin/extension is portable across browsers (e.g., it is supposed to run in FIrefox and more, as well as in Chrome). This because plugins/extensions adhere to a de facto standard introduced in Netscape 3.

If that's all true, then what are the advantages of NaCl over plugins/extensions?


Solution

  • In a word: security. NPAPI plugins are unsandboxable. They're native code, running out-of-process and outside of the browser's sandbox, meaning that they can do anything at all on your machine.

    NaCl, on the other hand, runs inside Chrome's sandbox, and provides access only to a well-defined set of APIs. Clever compilation tricks ensure that code can't break out and start (intentionally or accidentally) maliciously executing untrusted methods.

    http://www.chromium.org/nativeclient/getting-started/getting-started-background-and-basics is a good resource for an overview of the differences. I'd recommend at least skimming it to get an idea of what NaCl is trying to achieve.