Native Client is now built into the Dev channel of Google Chrome. This page tells you how to enable and use the integrated version of Native Client.
Note: For now, the integrated version of Native Client has less functionality than the plug-in. If you want to see everything that Native Client can do, download the tarball and install the plug-in. For details of what's different about the integrated version, see Known issues.
Contents:
How to enable Native Client in Google Chrome
- Download Google Chrome, if you don't already have it.
- Subscribe to the Dev channel.
- Launch Google Chrome from the command line, adding --enable-nacl. On Mac and Linux, if you're using dev channel release 5.0.375.9 or 5.0.371.0, respectively (or an earlier version), also add --no-sandbox. On Windows, your command should look like this:
chrome.exe --enable-nacl
Warning: We recommend running Google Chrome with the --no-sandbox or --enable-nacl flag only for testing Native Client and not for regular web browsing.
How to find and run examples and tests
- In any browser, bring up the Getting Started document. You'll follow some—but not all—of its instructions. Specifically:
- Get the software. (Download the tarball, extract the files, and make sure you have the right version of Python.)
- Start a local HTTP server, if one isn't already running on your computer.
- In Google Chrome, view the Browser Test Page, using localhost for the hostname. For example:
http://localhost:5103/scons-out/nacl-x86-32/staging/examples.html
- Click links to examples and tests to run them.
When Google Chrome is launched with the --enable-nacl flag, the integrated version of Native Client is used to run the examples and tests. Otherwise, the Native Client plug-in (if installed) is used to run them.
The following tests should work in the integrated version of Native Client:
- Tests that have no audio or graphics
The results of these tests should be the same as if you executed them in Google Chrome using the Native Client plug-in.
- Mandelbrot performance test
This works because all drawing is from JavaScript; Native Client is used only for calculations.
The following examples don't currently work:
- Examples with graphics (except for the Mandelbrot performance test)
This includes everything in the Examples column except the SRPC hello world example.
For details about what each example and test contains, see the Examples and Tests page and the README files in the source code.
Known issues
- Graphics and audio from native code don't work unless you're using the proposed NPAPI improvements (announcement, spec). These new 2D and 3D APIs provide access to video and audio.
- In some Dev-channel builds of Google Chrome, enabling Native Client requires disabling the Google Chrome sandbox.
More information
For information about the design and implementation of Google Chrome, see the Chromium project website.
I tried using the --internal-nacl command and Native Client failed. When I switched to --enable-nacl, everything worked flawlessly.
The correct flag is --internal-nacl. When you use --enable-nacl, the flag is ignored by Chrome; in this case it will use the NaCl plugin if you installed it previously. The failure you are seeing with --internal-nacl is a bug and I've filed an issue report (#106).
It looks like you might need to explicitly specify --no-sandbox, so I've added that to the instructions.
My OS is Vista and i am nether able to run the --internal nacl command nor the --enable nacl command. am i the only one facing this challenge?
The command line flags that are currently required to enable the built-in Native Client are "--internal-nacl" and "--no-sandbox". However, if you're using 64-bit Vista, that (and anything else 64-bit) doesn't work yet. Sorry about that.
This does not work on Mac. This is the error (the same error I've gotten trying to run Chrome from command-line before):
./Google\ Chrome --enable-nacl --no-sandbox [0801/214302:FATAL:/b/slave/chrome-official-mac/build/src/base/mac_util.mm(119)] Check failed: bundle. Failed to load the bundle at /Applications/Google Chrome.app/Contents/MacOS/Versions/5.0.375.99/Google Chrome Framework.framework
The same error happened to me using mac. It worked using the following command: open /Application/Google\ Chrome.app --args --enable-nacl --no-sandbox
The examples arent working,tried all the commands in windows. Help!!
I can't find instructions on how undo this. Everytime I launch Chromium (in Linux Mint 11 64bit) I get the message - "You are using an unsupported command line flag --enable-nacl. Stability and security will suffer." So I would like to remove or disable nacl but can't find information on how to do that.
Both the test targets from hello_world fail.
./scons test32 results in :
Error while loading "hello_world_test_x86_32_dbg.nexe": ELF executable text/rodata segment has wrong starting address Using the wrong type of nexe (nacl-x86-32 on an x86-64 or vice versa) or a corrupt nexe file may be responsible for this error. scons: test32? Error 1 scons: building terminated because of errors.