Manifest - File Handlers
Used by packaged apps
to specify what types of files the app can handle. An app can have multiple file_handlers, with each one having an identifier, a list of MIME types and/or a list of file extensions that can be handled, and
a title. Here's an example of specifying file handlers:
"file_handlers": {
"text": {
"types": [
"text/*"
],
"title": "Text editor"
},
"image": {
"types": [
"image/png",
"image/jpeg"
],
"extensions": [
"tiff"
],
"title": "Image editor"
},
"any": {
"extensions": [
"*"
],
"title": "Any file type editor"
}
}
To handle files, apps also need to declare the fileSystem permission. Apps can then be passed files in the app.runtime.onLaunched event - either from the system file manager (currently supported on ChromeOS only) or by providing a path on the command line.