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="/webstore">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"> | |
22 <h2 id="portable-native-client">Portable Native Client</h2> | 21 <h2 id="portable-native-client">Portable Native Client</h2> |
23 <p>Portable Native Client is enabled by default for web pages, so no separate | 22 <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 | 23 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 | 24 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> | 25 <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" /> | 26 <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 | 27 <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 | 28 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 | 29 <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 | 30 mechanism</a> should |
32 be used to safely host them on a different domain.</p> | 31 be used to safely host them on a different domain.</p> |
33 </section><section id="non-portable-native-client"> | |
34 <h2 id="non-portable-native-client">Non-portable Native Client</h2> | 32 <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 | 33 <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> | 34 Web Store (CWS)</a> |
37 The CWS requirement is in place to prevent the proliferation of Native Client | 35 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, | 36 executables (<strong>nexe</strong>s) compiled for specific architecures (e.g., x
86-32, |
39 x86-64, or ARM).</p> | 37 x86-64, or ARM).</p> |
40 <p>In general, the considerations and guidelines for distributing applications | 38 <p>In general, the considerations and guidelines for distributing applications |
41 through the Chrome Web Store apply to applications that contain NaCl modules as | 39 through the Chrome Web Store apply to applications that contain NaCl modules as |
42 well. Here are a few pointers to relevant documentation:</p> | 40 well. Here are a few pointers to relevant documentation:</p> |
43 <ul class="small-gap"> | 41 <ul class="small-gap"> |
44 <li><a class="reference external" href="/webstore">CWS Overview</a></li> | 42 <li><a class="reference external" href="/webstore">CWS Overview</a></li> |
45 <li><a class="reference external" href="/webstore/choosing">Choosing an App Type
</a></li> | 43 <li><a class="reference external" href="/webstore/choosing">Choosing an App Type
</a></li> |
46 <li><a class="reference external" href="/apps/about_apps">Getting started with p
ackaged apps</a></li> | 44 <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> | 45 <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="/extensions">Chrome extensions</a></li> | 46 <li><a class="reference external" href="/extensions">Chrome extensions</a></li> |
49 </ul> | 47 </ul> |
50 <p>In this document, we’ll focus only on distribution issues specific to | 48 <p>In this document, we’ll focus only on distribution issues specific to |
51 applications that contain NaCl modules.</p> | 49 applications that contain NaCl modules.</p> |
52 <section id="packaged-application"> | 50 <h3 id="packaged-application"><span id="distributing-packaged"></span>Packaged a
pplication</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 | 51 <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 | 52 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 | 53 Web Store manifest file (manifest.json), an icon, and all of the regular Native |
57 Client application files. Refer to | 54 Client application files. Refer to |
58 <a class="reference external" href="/apps/about_apps">Packaged Apps</a> | 55 <a class="reference external" href="/apps/about_apps">Packaged Apps</a> |
59 for more information about creating a packaged application.</p> | 56 for more information about creating a packaged application.</p> |
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> | 57 <h4 id="reducing-the-size-of-the-user-download-package">Reducing the size of the
user download package</h4> |
62 <aside class="note"> | 58 <aside class="note"> |
63 <strong>Tip:</strong> | 59 <strong>Tip:</strong> |
64 Packaging an app in a multi-platform zip file can significantly reduce the | 60 Packaging an app in a multi-platform zip file can significantly reduce the |
65 download and storage requirements for the app. | 61 download and storage requirements for the app. |
66 </aside> | 62 </aside> |
67 <p>As described above, to upload a packaged app to the CWS you have to create a
zip | 63 <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 | 64 file with all the resources that your app needs, including .nexe files for |
69 multiple architectures (x86-64, x86-32, and ARM). Prior to Chrome 28, when users | 65 multiple architectures (x86-64, x86-32, and ARM). Prior to Chrome 28, when users |
70 installed your app they had to download a .crx file from the CWS with all the | 66 installed your app they had to download a .crx file from the CWS with all the |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 function getPath(name) { | 225 function getPath(name) { |
230 return '_platform_specific/' + | 226 return '_platform_specific/' + |
231 chrome.runtime.getPlatformInfo().nacl_arch + | 227 chrome.runtime.getPlatformInfo().nacl_arch + |
232 '/' + name; | 228 '/' + name; |
233 } | 229 } |
234 </pre> | 230 </pre> |
235 </li> | 231 </li> |
236 <li><p class="first">Test your app, create a zip file, and upload the app to the
CWS as before.</p> | 232 <li><p class="first">Test your app, create a zip file, and upload the app to the
CWS as before.</p> |
237 </li> | 233 </li> |
238 </ol> | 234 </ol> |
239 </section><section id="additional-considerations-for-a-packaged-application"> | 235 <h4 id="additional-considerations-for-a-packaged-application"><span id="addition
al-considerations-packaged"></span>Additional considerations for a packaged appl
ication</h4> |
240 <span id="additional-considerations-packaged"></span><h4 id="additional-consider
ations-for-a-packaged-application"><span id="additional-considerations-packaged"
></span>Additional considerations for a packaged application</h4> | |
241 <ul class="small-gap"> | 236 <ul class="small-gap"> |
242 <li>In the description of your application in the CWS, make sure to mention that | 237 <li>In the description of your application in the CWS, make sure to mention that |
243 your application is a Native Client application that only works with the | 238 your application is a Native Client application that only works with the |
244 Chrome browser. Also make sure to identify the minimum version of Chrome | 239 Chrome browser. Also make sure to identify the minimum version of Chrome |
245 that your application requires.</li> | 240 that your application requires.</li> |
246 <li><p class="first">Hosted and packaged applications have a “launch”
; parameter in the CWS | 241 <li><p class="first">Hosted and packaged applications have a “launch”
; parameter in the CWS |
247 manifest. This parameter is present only in apps (not extensions), and it | 242 manifest. This parameter is present only in apps (not extensions), and it |
248 tells Google Chrome what to show when a user starts an installed app. For | 243 tells Google Chrome what to show when a user starts an installed app. For |
249 example:</p> | 244 example:</p> |
250 <pre> | 245 <pre> |
251 "launch": { | 246 "launch": { |
252 "web_url": "http://mail.google.com/mail/" | 247 "web_url": "http://mail.google.com/mail/" |
253 } | 248 } |
254 </pre> | 249 </pre> |
255 </li> | 250 </li> |
256 <li>If you want to write local data using the Pepper | 251 <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> | 252 <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 | 253 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 | 254 Store manifest file, just as you would for a JavaScript application that |
260 uses the HTML5 File API.</li> | 255 uses the HTML5 File API.</li> |
261 <li>For packaged applications, you can only use in-app purchases.</li> | 256 <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 | 257 <li>You can place your application in the Google Web Store with access only to |
263 certain people for testing. See <a class="reference external" href="/webstore/pu
blish">Publishing to test accounts</a> for more information.</li> | 258 certain people for testing. See <a class="reference external" href="/webstore/pu
blish">Publishing to test accounts</a> for more information.</li> |
264 </ul> | 259 </ul> |
265 </section></section><section id="extension"> | |
266 <h3 id="extension">Extension</h3> | 260 <h3 id="extension">Extension</h3> |
267 <p>The NaCl-specific notes for a <a class="reference internal" href="#distributi
ng-packaged"><em>package application</em></a> | 261 <p>The NaCl-specific notes for a <a class="reference internal" href="#distributi
ng-packaged"><em>package application</em></a> |
268 apply to extensions as well.</p> | 262 apply to extensions as well.</p> |
269 </section><section id="hosted-application"> | |
270 <h3 id="hosted-application">Hosted application</h3> | 263 <h3 id="hosted-application">Hosted application</h3> |
271 <p>The .html file, .nmf file (Native Client manifest file), and .nexe files must | 264 <p>The .html file, .nmf file (Native Client manifest file), and .nexe files must |
272 be served from the same domain, and the Chrome Web Store manifest file must | 265 be served from the same domain, and the Chrome Web Store manifest file must |
273 specify the correct, verified domain. Other files can be served from the same | 266 specify the correct, verified domain. Other files can be served from the same |
274 or another domain.</p> | 267 or another domain.</p> |
275 <p>In addition, see <a class="reference internal" href="#additional-consideratio
ns-packaged"><em>Additional considerations for a packaged application</em></a>.<
/p> | 268 <p>In addition, see <a class="reference internal" href="#additional-consideratio
ns-packaged"><em>Additional considerations for a packaged application</em></a>.<
/p> |
276 </section><section id="registering-native-client-modules-to-handle-mime-types"> | |
277 <h3 id="registering-native-client-modules-to-handle-mime-types">Registering Nati
ve Client modules to handle MIME types</h3> | 269 <h3 id="registering-native-client-modules-to-handle-mime-types">Registering Nati
ve Client modules to handle MIME types</h3> |
278 <p>If you want Chrome to use a Native Client module to display a particular type | 270 <p>If you want Chrome to use a Native Client module to display a particular type |
279 of content, you can associate the MIME type of that content with the Native | 271 of content, you can associate the MIME type of that content with the Native |
280 Client module. Use the <code>nacl_modules</code> attribute in the Chrome Web Sto
re | 272 Client module. Use the <code>nacl_modules</code> attribute in the Chrome Web Sto
re |
281 manifest file to register a Native Client module as the handler for one or more | 273 manifest file to register a Native Client module as the handler for one or more |
282 specific MIME types. For example, the bold code in the snippet below registers | 274 specific MIME types. For example, the bold code in the snippet below registers |
283 a Native Client module as the content handler for the OpenOffice spreadsheet | 275 a Native Client module as the content handler for the OpenOffice spreadsheet |
284 MIME type:</p> | 276 MIME type:</p> |
285 <pre> | 277 <pre> |
286 { | 278 { |
(...skipping 28 matching lines...) Expand all Loading... |
315 }, | 307 }, |
316 { | 308 { |
317 "path": "DocumentViewer.nmf", | 309 "path": "DocumentViewer.nmf", |
318 "mime_type": "application/vnd.oasis.opendocument.text" | 310 "mime_type": "application/vnd.oasis.opendocument.text" |
319 }] | 311 }] |
320 } | 312 } |
321 </pre> | 313 </pre> |
322 <p>The <code>nacl_modules</code> attribute is optional—specify this attrib
ute only if | 314 <p>The <code>nacl_modules</code> attribute is optional—specify this attrib
ute only if |
323 you want Chrome to use a Native Client module to display a particular type of | 315 you want Chrome to use a Native Client module to display a particular type of |
324 content.</p> | 316 content.</p> |
325 </section></section></section> | 317 </section> |
326 | 318 |
327 {{/partials.standard_nacl_article}} | 319 {{/partials.standard_nacl_article}} |
OLD | NEW |