| OLD | NEW |
| 1 .. _distributing: | 1 .. _distributing: |
| 2 | 2 |
| 3 ############################# | 3 ############################# |
| 4 Distributing Your Application | 4 Distributing Your Application |
| 5 ############################# | 5 ############################# |
| 6 | 6 |
| 7 .. contents:: | 7 .. contents:: |
| 8 :local: | 8 :local: |
| 9 :backlinks: none | 9 :backlinks: none |
| 10 :depth: 2 | 10 :depth: 2 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 The CWS requirement is in place to prevent the proliferation of Native Client | 38 The CWS requirement is in place to prevent the proliferation of Native Client |
| 39 executables (**nexe**\s) compiled for specific architecures (e.g., x86-32, | 39 executables (**nexe**\s) compiled for specific architecures (e.g., x86-32, |
| 40 x86-64, or ARM). | 40 x86-64, or ARM). |
| 41 | 41 |
| 42 In general, the considerations and guidelines for distributing applications | 42 In general, the considerations and guidelines for distributing applications |
| 43 through the Chrome Web Store apply to applications that contain NaCl modules as | 43 through the Chrome Web Store apply to applications that contain NaCl modules as |
| 44 well. Here are a few pointers to relevant documentation: | 44 well. Here are a few pointers to relevant documentation: |
| 45 | 45 |
| 46 * `CWS Overview </webstore>`_ | 46 * `CWS Overview </webstore>`_ |
| 47 * `Choosing an App Type </webstore/choosing>`_ | 47 * `Choosing an App Type </webstore/choosing>`_ |
| 48 * `Getting started with packaged apps </apps/about_apps>`_ | 48 * `Getting started with Chrome apps </apps>`_ |
| 49 * `Hosted apps <https://developers.google.com/chrome/apps/docs/developers_guide>
`_ | |
| 50 * `Chrome extensions </extensions>`_ | 49 * `Chrome extensions </extensions>`_ |
| 51 | 50 |
| 52 In this document, we'll focus only on distribution issues specific to | 51 In this document, we'll focus only on distribution issues specific to |
| 53 applications that contain NaCl modules. | 52 applications that contain NaCl modules. |
| 54 | 53 |
| 55 .. _distributing_packaged: | 54 .. _distributing_packaged: |
| 56 | 55 |
| 57 Packaged application | 56 Chrome apps |
| 58 -------------------- | 57 ----------- |
| 59 | 58 |
| 60 A packaged application is a special zip file (with a .crx extension) hosted in | 59 A Chrome app is a special zip file (with a .crx extension) hosted in the Chrome |
| 61 the Chrome Web Store. This file contains all of the application parts: A Chrome | 60 Web Store. This file contains all of the application parts: A Chrome Web Store |
| 62 Web Store manifest file (manifest.json), an icon, and all of the regular Native | 61 manifest file (manifest.json), an icon, and all of the regular Native Client |
| 63 Client application files. Refer to | 62 application files. Refer to `Chrome Apps </apps>`_ for more information about |
| 64 `Packaged Apps </apps/about_apps>`_ | 63 creating a Chrome app. |
| 65 for more information about creating a packaged application. | |
| 66 | 64 |
| 67 Reducing the size of the user download package | 65 Reducing the size of the user download package |
| 68 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | 66 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 69 | 67 |
| 70 .. Note:: | 68 .. Note:: |
| 71 :class: note | 69 :class: note |
| 72 | 70 |
| 73 **Tip:** | 71 **Tip:** |
| 74 Packaging an app in a multi-platform zip file can significantly reduce the | 72 Packaging an app in a multi-platform zip file can significantly reduce the |
| 75 download and storage requirements for the app. | 73 download and storage requirements for the app. |
| 76 | 74 |
| 77 As described above, to upload a packaged app to the CWS you have to create a zip | 75 As described above, to upload a Chrome app to the CWS you have to create a zip |
| 78 file with all the resources that your app needs, including .nexe files for | 76 file with all the resources that your app needs, including .nexe files for |
| 79 multiple architectures (x86-64, x86-32, and ARM). Prior to Chrome 28, when users | 77 multiple architectures (x86-64, x86-32, and ARM). Prior to Chrome 28, when users |
| 80 installed your app they had to download a .crx file from the CWS with all the | 78 installed your app they had to download a .crx file from the CWS with all the |
| 81 included .nexe files. | 79 included .nexe files. |
| 82 | 80 |
| 83 Starting with Chrome 28, the Chrome Web Store includes a feature called | 81 Starting with Chrome 28, the Chrome Web Store includes a feature called |
| 84 **multi-platform zip files.** This feature lets you structure your application | 82 **multi-platform zip files.** This feature lets you structure your application |
| 85 directory and zip file in a way that reduces the size of the user download | 83 directory and zip file in a way that reduces the size of the user download |
| 86 package. Here's how this feature works: | 84 package. Here's how this feature works: |
| 87 | 85 |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 function getPath(name) { | 230 function getPath(name) { |
| 233 return '_platform_specific/' + | 231 return '_platform_specific/' + |
| 234 chrome.runtime.getPlatformInfo().nacl_arch + | 232 chrome.runtime.getPlatformInfo().nacl_arch + |
| 235 '/' + name; | 233 '/' + name; |
| 236 } | 234 } |
| 237 | 235 |
| 238 #. Test your app, create a zip file, and upload the app to the CWS as before. | 236 #. Test your app, create a zip file, and upload the app to the CWS as before. |
| 239 | 237 |
| 240 .. _additional_considerations_packaged: | 238 .. _additional_considerations_packaged: |
| 241 | 239 |
| 242 Additional considerations for a packaged application | 240 Additional considerations for a Chrome app |
| 243 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | 241 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 244 | 242 |
| 245 * In the description of your application in the CWS, make sure to mention that | 243 * In the description of your application in the CWS, make sure to mention that |
| 246 your application is a Native Client application that only works with the | 244 your application is a Native Client application that only works with the |
| 247 Chrome browser. Also make sure to identify the minimum version of Chrome | 245 Chrome browser. Also make sure to identify the minimum version of Chrome |
| 248 that your application requires. | 246 that your application requires. |
| 249 * Hosted and packaged applications have a "launch" parameter in the CWS | 247 * Hosted and packaged applications have a "launch" parameter in the CWS |
| 250 manifest. This parameter is present only in apps (not extensions), and it | 248 manifest. This parameter is present only in apps (not extensions), and it |
| 251 tells Google Chrome what to show when a user starts an installed app. For | 249 tells Google Chrome what to show when a user starts an installed app. For |
| 252 example: | 250 example: |
| 253 | 251 |
| 254 .. naclcode:: | 252 .. naclcode:: |
| 255 :prettyprint: 0 | 253 :prettyprint: 0 |
| 256 | 254 |
| 257 "launch": { | 255 "launch": { |
| 258 "web_url": "http://mail.google.com/mail/" | 256 "web_url": "http://mail.google.com/mail/" |
| 259 } | 257 } |
| 260 | 258 |
| 261 * If you want to write local data using the Pepper | 259 * If you want to write local data using the Pepper |
| 262 `FileIO </native-client/peppercpp/classpp_1_1_file_i_o>`_ | 260 `FileIO </native-client/peppercpp/classpp_1_1_file_i_o>`_ |
| 263 API, you must set the 'unlimitedStorage' permission in your Chrome Web | 261 API, you must set the 'unlimitedStorage' permission in your Chrome Web |
| 264 Store manifest file, just as you would for a JavaScript application that | 262 Store manifest file, just as you would for a JavaScript application that |
| 265 uses the HTML5 File API. | 263 uses the HTML5 File API. |
| 266 * For packaged applications, you can only use in-app purchases. | 264 * For Chrome apps, you can only use in-app purchases. |
| 267 * You can place your application in the Google Web Store with access only to | 265 * You can place your application in the Google Web Store with access only to |
| 268 certain people for testing. See `Publishing to test accounts | 266 certain people for testing. See `Publishing to test accounts |
| 269 </webstore/publish>`_ for more information. | 267 </webstore/publish>`_ for more information. |
| 270 | 268 |
| 271 Extension | 269 Extension |
| 272 --------- | 270 --------- |
| 273 | 271 |
| 274 The NaCl-specific notes for a :ref:`package application <distributing_packaged>` | 272 The NaCl-specific notes for a :ref:`package application <distributing_packaged>` |
| 275 apply to extensions as well. | 273 apply to extensions as well. |
| 276 | 274 |
| 277 Hosted application | 275 Hosted application |
| 278 ------------------ | 276 ------------------ |
| 279 | 277 |
| 280 The .html file, .nmf file (Native Client manifest file), and .nexe files must | 278 The .html file, .nmf file (Native Client manifest file), and .nexe files must |
| 281 be served from the same domain, and the Chrome Web Store manifest file must | 279 be served from the same domain, and the Chrome Web Store manifest file must |
| 282 specify the correct, verified domain. Other files can be served from the same | 280 specify the correct, verified domain. Other files can be served from the same |
| 283 or another domain. | 281 or another domain. |
| 284 | 282 |
| 285 In addition, see :ref:`Additional considerations for a packaged application <add
itional_considerations_packaged>`. | 283 In addition, see :ref:`Additional considerations for a Chrome apps |
| 284 <additional_considerations_packaged>`. |
| 286 | 285 |
| 287 Registering Native Client modules to handle MIME types | 286 Registering Native Client modules to handle MIME types |
| 288 ------------------------------------------------------ | 287 ------------------------------------------------------ |
| 289 | 288 |
| 290 If you want Chrome to use a Native Client module to display a particular type | 289 If you want Chrome to use a Native Client module to display a particular type |
| 291 of content, you can associate the MIME type of that content with the Native | 290 of content, you can associate the MIME type of that content with the Native |
| 292 Client module. Use the ``nacl_modules`` attribute in the Chrome Web Store | 291 Client module. Use the ``nacl_modules`` attribute in the Chrome Web Store |
| 293 manifest file to register a Native Client module as the handler for one or more | 292 manifest file to register a Native Client module as the handler for one or more |
| 294 specific MIME types. For example, the bold code in the snippet below registers | 293 specific MIME types. For example, the bold code in the snippet below registers |
| 295 a Native Client module as the content handler for the OpenOffice spreadsheet | 294 a Native Client module as the content handler for the OpenOffice spreadsheet |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 { | 334 { |
| 336 "path": "DocumentViewer.nmf", | 335 "path": "DocumentViewer.nmf", |
| 337 "mime_type": "application/vnd.oasis.opendocument.text" | 336 "mime_type": "application/vnd.oasis.opendocument.text" |
| 338 }] | 337 }] |
| 339 } | 338 } |
| 340 | 339 |
| 341 The ``nacl_modules`` attribute is optional---specify this attribute only if | 340 The ``nacl_modules`` attribute is optional---specify this attribute only if |
| 342 you want Chrome to use a Native Client module to display a particular type of | 341 you want Chrome to use a Native Client module to display a particular type of |
| 343 content. | 342 content. |
| 344 | 343 |
| OLD | NEW |