You are viewing extension docs in chrome via the 'file:' scheme: are you expecting to see local changes when you refresh? You'll need run chrome with --allow-file-access-from-files.
paramName
( optional enumerated Type array of paramType )
Undocumented.
Description of this parameter from the json schema.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key minimum_chrome_version can ensure that your extension won't be run in an earlier browser version.
Parameters
  1. Properties
    1. propertyName
  2. Methods
    1. methodName
  3. Events
    1. eventName
  4. Types
    1. id

Google Chrome Extensions (Labs)

chrome.fileBrowserHandler

Use the chrome.fileBrowserHandler module to extend the Chrome OS file browser. For example, you can use this API to enable users to upload files to your website.

Important: This API works only on Chrome OS.

The Chrome OS file browser comes up when the user either presses Ctrl+M or connects an external storage device, such as an SD card, USB key, external drive, or digital camera. Besides showing the files on external devices, the file browser can also display files that the user has previously saved to the system.

When the user selects one or more files, the file browser adds buttons representing the valid handlers for those files. For example, in the following screenshot, selecting a file with a ".jpg" suffix results in an "Upload to Picasa" button that the user can click.

file browser screenshot

Manifest

You must declare the "fileBrowserHandler" permission in the extension manifest, and you must use the "file_browser_handlers" field to register the extension as a handler of at least one file type. You should also provide a 16x16 icon to be displayed on the button. For example:

{
  "name": "My extension",
  ...
  "file_browser_handlers": [
    {
      "id": "upload",
      "default_title": "Save to Gallery", // What the button will display
      "file_filters": [
        "filesystem:*.jpg", // To match all files, use "filesystem:*.*"
        "filesystem:*.jpeg",
        "filesystem:*.png"
      ]
    }
  ],
  "permissions" : [
    "fileBrowserHandler"
  ],
  "icons": { "16": "icon16.png",
             "48": "icon48.png",
            "128": "icon128.png" },
  ...
}

Note: You can specify locale-specific strings for the value of "default_title". See Internationalization (i18n) for details.

Implementing a file browser handler

To use this API, you must implement a function that handles the onExecute event of chrome.fileBrowserHandler. Your function will be called whenever the user clicks the button that represents your file browser handler. In your function, use the HTML5 FileSystem API to get access to the file contents. Here is an example:

//In background.html:
chrome.fileBrowserHandler.onExecute.addListener(function(id, details) {
  if (id == 'upload') {
    var fileEntries = details.entries;
    for (var i = 0, entry; entry = fileEntries[i]; ++i) {
      entry.file(function(file) {
        // send file somewhere
      });
    }
  }
});

Your event handler is passed two arguments:

id
The "id" value from the manifest file. If your extension implements multiple handlers, you can check the id value to see which handler has been triggered.
details
An object describing the event. You can get the file or files that the user has selected from the entries field of this object, which is an array of FileSystem Entry objects.

API reference: chrome.fileBrowserHandler

Events

onExecute

chrome.fileBrowserHandler.onExecute.addListener(function(string id, FileHandlerExecuteEventDetails details) {...});

Fired when file system action is executed from ChromeOS file browser.

Listener parameters

id
( Type array of string )
File browser action id as specified in the listener component's manifest.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key minimum_chrome_version can ensure that your extension won't be run in an earlier browser version.
details
( FileHandlerExecuteEventDetails array of paramType )
File handler execute event details.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key minimum_chrome_version can ensure that your extension won't be run in an earlier browser version.

Extra parameters to addListener

Listener returns

Types

FileHandlerExecuteEventDetails

paramName
( Type array of object )
Event details payload for fileBrowserHandler.onExecute event.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key minimum_chrome_version can ensure that your extension won't be run in an earlier browser version.
entries
( Type array of any )
Array of Entry instances representing files that are targets of this action (selected in ChromeOS file browser).
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key minimum_chrome_version can ensure that your extension won't be run in an earlier browser version.
tab_id
( optional Type array of integer )
The ID of the tab that raised this event. Tab IDs are unique within a browser session.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key minimum_chrome_version can ensure that your extension won't be run in an earlier browser version.