OLD | NEW |
1 <h1 id="file_handlers">Manifest - File Handlers</h1> | 1 <h1 id="file_handlers">Manifest - File Handlers</h1> |
2 | 2 |
3 <p> | 3 <p> |
4 Used by <a href="../app_lifecycle.html#eventpage">packaged apps</a> | 4 Used by <a href="../app_lifecycle#eventpage">packaged apps</a> |
5 to specify what types of files the app can handle. An app can have multiple <cod
e>file_handlers</code>, with each one having an identifier, a list of MIME types
and/or a list of file extensions that can be handled, and | 5 to specify what types of files the app can handle. An app can have multiple <cod
e>file_handlers</code>, with each one having an identifier, a list of MIME types
and/or a list of file extensions that can be handled, and |
6 a title. Here's an example of specifying file handlers: | 6 a title. Here's an example of specifying file handlers: |
7 </p> | 7 </p> |
8 | 8 |
9 <pre data-filename="manifest.json"> | 9 <pre data-filename="manifest.json"> |
10 "file_handlers": { | 10 "file_handlers": { |
11 "text": { | 11 "text": { |
12 "types": [ | 12 "types": [ |
13 "text/*" | 13 "text/*" |
14 ], | 14 ], |
(...skipping 16 matching lines...) Expand all Loading... |
31 "title": "Any file type editor" | 31 "title": "Any file type editor" |
32 } | 32 } |
33 } | 33 } |
34 </pre> | 34 </pre> |
35 | 35 |
36 <p> | 36 <p> |
37 To handle files, apps also need to declare the $(ref:fileSystem) | 37 To handle files, apps also need to declare the $(ref:fileSystem) |
38 permission. Apps can then be passed files in the $(ref:app.runtime.onLaunched) | 38 permission. Apps can then be passed files in the $(ref:app.runtime.onLaunched) |
39 event - either from the system | 39 event - either from the system |
40 file manager (currently supported on ChromeOS only) or by providing | 40 file manager (currently supported on ChromeOS only) or by providing |
41 a path on the <a href="../first_app.html#open">command line</a>. | 41 a path on the <a href="../first_app#open">command line</a>. |
42 </p> | 42 </p> |
OLD | NEW |