OLD | NEW |
1 {{+bindTo:partials.standard_nacl_article}} | 1 {{+bindTo:partials.standard_nacl_article}} |
2 | 2 |
3 <section id="distributing-your-application"> | 3 <section id="distributing-your-application"> |
4 <span id="distributing"></span><h1 id="distributing-your-application"><span id="
distributing"></span>Distributing Your Application</h1> | 4 <span id="distributing"></span><h1 id="distributing-your-application"><span id="
distributing"></span>Distributing Your Application</h1> |
5 <div class="contents local" id="contents" style="display: none"> | 5 <div class="contents local" id="contents" style="display: none"> |
6 <ul class="small-gap"> | 6 <ul class="small-gap"> |
7 <li><a class="reference internal" href="#portable-native-client" id="id1">Portab
le Native Client</a></li> | 7 <li><a class="reference internal" href="#portable-native-client" id="id1">Portab
le Native Client</a></li> |
8 <li><p class="first"><a class="reference internal" href="#non-portable-native-cl
ient" id="id2">Non-portable Native Client</a></p> | 8 <li><p class="first"><a class="reference internal" href="#non-portable-native-cl
ient" id="id2">Non-portable Native Client</a></p> |
9 <ul class="small-gap"> | 9 <ul class="small-gap"> |
10 <li><a class="reference internal" href="#packaged-application" id="id3">Packaged
application</a></li> | 10 <li><a class="reference internal" href="#packaged-application" id="id3">Packaged
application</a></li> |
11 <li><a class="reference internal" href="#extension" id="id4">Extension</a></li> | 11 <li><a class="reference internal" href="#extension" id="id4">Extension</a></li> |
12 <li><a class="reference internal" href="#hosted-application" id="id5">Hosted app
lication</a></li> | 12 <li><a class="reference internal" href="#hosted-application" id="id5">Hosted app
lication</a></li> |
13 <li><a class="reference internal" href="#registering-native-client-modules-to-ha
ndle-mime-types" id="id6">Registering Native Client modules to handle MIME types
</a></li> | 13 <li><a class="reference internal" href="#registering-native-client-modules-to-ha
ndle-mime-types" id="id6">Registering Native Client modules to handle MIME types
</a></li> |
14 </ul> | 14 </ul> |
15 </li> | 15 </li> |
16 </ul> | 16 </ul> |
17 | 17 |
18 </div><p>This document describes how to distribute Portable Native Client applic
ations | 18 </div><p>This document describes how to distribute Portable Native Client applic
ations |
19 on the web, and Native Client applications through the | 19 on the web, and Native Client applications through the |
20 <a class="reference external" href="/chrome/web-store/docs/">Chrome Web Store</a
> (CWS).</p> | 20 <a class="reference external" href="/webstore">Chrome Web Store</a> (CWS).</p> |
21 <section id="portable-native-client"> | 21 <section id="portable-native-client"> |
22 <h2 id="portable-native-client">Portable Native Client</h2> | 22 <h2 id="portable-native-client">Portable Native Client</h2> |
23 <p>Portable Native Client is enabled by default for web pages, so no separate | 23 <p>Portable Native Client is enabled by default for web pages, so no separate |
24 distribution step is requred. Making PNaCl a part of your web application is as | 24 distribution step is requred. Making PNaCl a part of your web application is as |
25 simple as embedding a manifest file that points to a <strong>pexe</strong>. See
the | 25 simple as embedding a manifest file that points to a <strong>pexe</strong>. See
the |
26 <a class="reference internal" href="/native-client/overview.html"><em>technical
overview</em></a> for more details.</p> | 26 <a class="reference internal" href="/native-client/overview.html"><em>technical
overview</em></a> for more details.</p> |
27 <img alt="/native-client/images/nacl-in-a-web-app.png" src="/native-client/image
s/nacl-in-a-web-app.png" /> | 27 <img alt="/native-client/images/nacl-in-a-web-app.png" src="/native-client/image
s/nacl-in-a-web-app.png" /> |
28 <p>The only constraint for distributing PNaCl modules with a web application is | 28 <p>The only constraint for distributing PNaCl modules with a web application is |
29 abiding by the <a class="reference external" href="http://en.wikipedia.org/wiki/
Same_origin_policy">Same-origin policy</a>. The PNaCl manifest and | 29 abiding by the <a class="reference external" href="http://en.wikipedia.org/wiki/
Same_origin_policy">Same-origin policy</a>. The PNaCl manifest and |
30 <strong>pexe</strong> must either be served from the same domain with the HTML,
or the <a class="reference external" href="http://en.wikipedia.org/wiki/Cross-or
igin_resource_sharing">CORS | 30 <strong>pexe</strong> must either be served from the same domain with the HTML,
or the <a class="reference external" href="http://en.wikipedia.org/wiki/Cross-or
igin_resource_sharing">CORS |
31 mechanism</a> should | 31 mechanism</a> should |
32 be used to safely host them on a different domain.</p> | 32 be used to safely host them on a different domain.</p> |
33 </section><section id="non-portable-native-client"> | 33 </section><section id="non-portable-native-client"> |
34 <h2 id="non-portable-native-client">Non-portable Native Client</h2> | 34 <h2 id="non-portable-native-client">Non-portable Native Client</h2> |
35 <p>NaCl modules are only allowed for applications distributed through the <a cla
ss="reference external" href="https://chrome.google.com/webstore/category/apps">
Chrome | 35 <p>NaCl modules are only allowed for applications distributed through the <a cla
ss="reference external" href="https://chrome.google.com/webstore/category/apps">
Chrome |
36 Web Store (CWS)</a> | 36 Web Store (CWS)</a> |
37 The CWS requirement is in place to prevent the proliferation of Native Client | 37 The CWS requirement is in place to prevent the proliferation of Native Client |
38 executables (<strong>nexe</strong>s) compiled for specific architecures (e.g., x
86-32, | 38 executables (<strong>nexe</strong>s) compiled for specific architecures (e.g., x
86-32, |
39 x86-64, or ARM).</p> | 39 x86-64, or ARM).</p> |
40 <p>In general, the considerations and guidelines for distributing applications | 40 <p>In general, the considerations and guidelines for distributing applications |
41 through the Chrome Web Store apply to applications that contain NaCl modules as | 41 through the Chrome Web Store apply to applications that contain NaCl modules as |
42 well. Here are a few pointers to relevant documentation:</p> | 42 well. Here are a few pointers to relevant documentation:</p> |
43 <ul class="small-gap"> | 43 <ul class="small-gap"> |
44 <li><a class="reference external" href="https://developers.google.com/chrome/web
-store/docs/">CWS Overview</a></li> | 44 <li><a class="reference external" href="/webstore">CWS Overview</a></li> |
45 <li><a class="reference external" href="https://developers.google.com/chrome/web
-store/docs/choosing">Choosing an App Type</a></li> | 45 <li><a class="reference external" href="/webstore/choosing">Choosing an App Type
</a></li> |
46 <li><a class="reference external" href="http://developer.chrome.com/apps/about_a
pps.html">Getting started with packaged apps</a></li> | 46 <li><a class="reference external" href="/apps/about_apps">Getting started with p
ackaged apps</a></li> |
47 <li><a class="reference external" href="https://developers.google.com/chrome/app
s/docs/developers_guide">Hosted apps</a></li> | 47 <li><a class="reference external" href="https://developers.google.com/chrome/app
s/docs/developers_guide">Hosted apps</a></li> |
48 <li><a class="reference external" href="http://developer.chrome.com/extensions/i
ndex.html">Chrome extensions</a></li> | 48 <li><a class="reference external" href="/extensions">Chrome extensions</a></li> |
49 </ul> | 49 </ul> |
50 <p>In this document, we’ll focus only on distribution issues specific to | 50 <p>In this document, we’ll focus only on distribution issues specific to |
51 applications that contain NaCl modules.</p> | 51 applications that contain NaCl modules.</p> |
52 <section id="packaged-application"> | 52 <section id="packaged-application"> |
53 <span id="distributing-packaged"></span><h3 id="packaged-application"><span id="
distributing-packaged"></span>Packaged application</h3> | 53 <span id="distributing-packaged"></span><h3 id="packaged-application"><span id="
distributing-packaged"></span>Packaged application</h3> |
54 <p>A packaged application is a special zip file (with a .crx extension) hosted i
n | 54 <p>A packaged application is a special zip file (with a .crx extension) hosted i
n |
55 the Chrome Web Store. This file contains all of the application parts: A Chrome | 55 the Chrome Web Store. This file contains all of the application parts: A Chrome |
56 Web Store manifest file (manifest.json), an icon, and all of the regular Native | 56 Web Store manifest file (manifest.json), an icon, and all of the regular Native |
57 Client application files. Refer to | 57 Client application files. Refer to |
58 <a class="reference external" href="https://developer.chrome.com/apps/about_apps
.html">Packaged Apps</a> | 58 <a class="reference external" href="/apps/about_apps">Packaged Apps</a> |
59 for more information about creating a packaged application.</p> | 59 for more information about creating a packaged application.</p> |
60 <section id="reducing-the-size-of-the-user-download-package"> | 60 <section id="reducing-the-size-of-the-user-download-package"> |
61 <h4 id="reducing-the-size-of-the-user-download-package">Reducing the size of the
user download package</h4> | 61 <h4 id="reducing-the-size-of-the-user-download-package">Reducing the size of the
user download package</h4> |
62 <aside class="note"> | 62 <aside class="note"> |
63 <strong>Tip:</strong> | 63 <strong>Tip:</strong> |
64 Packaging an app in a multi-platform zip file can significantly reduce the | 64 Packaging an app in a multi-platform zip file can significantly reduce the |
65 download and storage requirements for the app. | 65 download and storage requirements for the app. |
66 </aside> | 66 </aside> |
67 <p>As described above, to upload a packaged app to the CWS you have to create a
zip | 67 <p>As described above, to upload a packaged app to the CWS you have to create a
zip |
68 file with all the resources that your app needs, including .nexe files for | 68 file with all the resources that your app needs, including .nexe files for |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 <p>Note the last entry in the CWS manifest file above, which specifies a | 214 <p>Note the last entry in the CWS manifest file above, which specifies a |
215 <code>sub_package_path</code> without a corresponding <code>nacl_arch</code>. Th
is entry | 215 <code>sub_package_path</code> without a corresponding <code>nacl_arch</code>. Th
is entry |
216 identifies the fallback directory, which is included in the download | 216 identifies the fallback directory, which is included in the download |
217 package if the user architecture does not match any of the listed NaCl | 217 package if the user architecture does not match any of the listed NaCl |
218 architectures, or if the user is using an older version of Chrome that | 218 architectures, or if the user is using an older version of Chrome that |
219 does not support multi-platform zip files.</p> | 219 does not support multi-platform zip files.</p> |
220 </li> | 220 </li> |
221 <li><p class="first">Modify your application as necessary so that it uses the fi
les for the | 221 <li><p class="first">Modify your application as necessary so that it uses the fi
les for the |
222 correct user architecture.</p> | 222 correct user architecture.</p> |
223 <p>To reference architecture-specific files, use the JavaScript API | 223 <p>To reference architecture-specific files, use the JavaScript API |
224 <a class="reference external" href="http://developer.chrome.com/trunk/extensions
/runtime.html#method-getPlatformInfo">chrome.runtime.getPlatformInfo()</a>. | 224 <a class="reference external" href="/extensions/runtime.html#method-getPlatformI
nfo">chrome.runtime.getPlatformInfo()</a>. |
225 As an example, if you have architecture-specific files in the directories | 225 As an example, if you have architecture-specific files in the directories |
226 <code>x86-64</code>, <code>x86-32</code>, and <code>arm</code>, you can use the
following JavaScript | 226 <code>x86-64</code>, <code>x86-32</code>, and <code>arm</code>, you can use the
following JavaScript |
227 code to create a path for the files:</p> | 227 code to create a path for the files:</p> |
228 <pre class="prettyprint"> | 228 <pre class="prettyprint"> |
229 function getPath(name) { | 229 function getPath(name) { |
230 return '_platform_specific/' + | 230 return '_platform_specific/' + |
231 chrome.runtime.getPlatformInfo().nacl_arch + | 231 chrome.runtime.getPlatformInfo().nacl_arch + |
232 '/' + name; | 232 '/' + name; |
233 } | 233 } |
234 </pre> | 234 </pre> |
(...skipping 18 matching lines...) Expand all Loading... |
253 } | 253 } |
254 </pre> | 254 </pre> |
255 </li> | 255 </li> |
256 <li>If you want to write local data using the Pepper | 256 <li>If you want to write local data using the Pepper |
257 <a class="reference external" href="/native-client/peppercpp/classpp_1_1_file_i_
o">FileIO</a> | 257 <a class="reference external" href="/native-client/peppercpp/classpp_1_1_file_i_
o">FileIO</a> |
258 API, you must set the ‘unlimitedStorage’ permission in your Chrome W
eb | 258 API, you must set the ‘unlimitedStorage’ permission in your Chrome W
eb |
259 Store manifest file, just as you would for a JavaScript application that | 259 Store manifest file, just as you would for a JavaScript application that |
260 uses the HTML5 File API.</li> | 260 uses the HTML5 File API.</li> |
261 <li>For packaged applications, you can only use in-app purchases.</li> | 261 <li>For packaged applications, you can only use in-app purchases.</li> |
262 <li>You can place your application in the Google Web Store with access only to | 262 <li>You can place your application in the Google Web Store with access only to |
263 certain people for testing. See | 263 certain people for testing. See <a class="reference external" href="/webstore/pu
blish">Publishing to test accounts</a> for more information.</li> |
264 <a class="reference external" href="https://developers.google.com/chrome/web-sto
re/docs/publish">Publishing to test accounts</a> | |
265 for more information.</li> | |
266 </ul> | 264 </ul> |
267 </section></section><section id="extension"> | 265 </section></section><section id="extension"> |
268 <h3 id="extension">Extension</h3> | 266 <h3 id="extension">Extension</h3> |
269 <p>The NaCl-specific notes for a <a class="reference internal" href="#distributi
ng-packaged"><em>package application</em></a> | 267 <p>The NaCl-specific notes for a <a class="reference internal" href="#distributi
ng-packaged"><em>package application</em></a> |
270 apply to extensions as well.</p> | 268 apply to extensions as well.</p> |
271 </section><section id="hosted-application"> | 269 </section><section id="hosted-application"> |
272 <h3 id="hosted-application">Hosted application</h3> | 270 <h3 id="hosted-application">Hosted application</h3> |
273 <p>The .html file, .nmf file (Native Client manifest file), and .nexe files must | 271 <p>The .html file, .nmf file (Native Client manifest file), and .nexe files must |
274 be served from the same domain, and the Chrome Web Store manifest file must | 272 be served from the same domain, and the Chrome Web Store manifest file must |
275 specify the correct, verified domain. Other files can be served from the same | 273 specify the correct, verified domain. Other files can be served from the same |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 "mime_type": "application/vnd.oasis.opendocument.text" | 318 "mime_type": "application/vnd.oasis.opendocument.text" |
321 }] | 319 }] |
322 } | 320 } |
323 </pre> | 321 </pre> |
324 <p>The <code>nacl_modules</code> attribute is optional—specify this attrib
ute only if | 322 <p>The <code>nacl_modules</code> attribute is optional—specify this attrib
ute only if |
325 you want Chrome to use a Native Client module to display a particular type of | 323 you want Chrome to use a Native Client module to display a particular type of |
326 content.</p> | 324 content.</p> |
327 </section></section></section> | 325 </section></section></section> |
328 | 326 |
329 {{/partials.standard_nacl_article}} | 327 {{/partials.standard_nacl_article}} |
OLD | NEW |