fileBrowserHandler

The fileBrowserHandler permission allows a ChromeOS extension to extend the ChromeOS file browser.

This is a ChromeOS-only permission. It will have no effect on other operating systems.

What it does

  • Registers the extension as a "handler" for certain file types in the ChromeOS Files app.
  • When a user tries to open a file of a matching type, the extension can be listed as an option in the "Open with" menu.
  • The extension can then receive the file and perform actions on it.

When to use it

This is for creating applications on ChromeOS that can edit or view specific file types.

Examples:

  • An image editor that can open and edit .png and .jpg files directly from the Files app.
  • A custom text editor for programmers that handles file types like .js or .py.
  • A video player that can play specific media formats.

Manifest Declaration

In addition to the permission, you must define the file_browser_handlers key in the manifest.

{
  "name": "My ChromeOS Text Editor",
  "version": "1.0",
  "manifest_version": 3,
  "permissions": [
    "fileBrowserHandler"
  ],
  "file_browser_handlers": [
    {
      "id": "open",
      "default_title": "Open with My Text Editor",
      "file_filters": [
        "filesystem:*.txt",
        "filesystem:*.md"
      ]
    }
  ]
}

Security & Privacy

Why is it not risky?

This permission (only for ChromeOS) lets an extension appear in the "Open with" menu for certain files. For example, a photo editor could open .jpg files.

This is safe because the extension can only access files that you explicitly choose to open with it. It does not have general access to your file system and cannot see any other files. You are always in control.

API Usage Example

The API is event-based. The service worker listens for the onExecute event.

// background.js

// Listen for when the user selects our handler from the Files app
chrome.fileBrowserHandler.onExecute.addListener((id, details) => {
  if (id === 'open') {
    console.log('File handler executed.');
    console.log('File entries:', details.entries);

    details.entries.forEach(entry => {
      console.log(`Processing file: ${entry.name}`);
      // In a real app, you would open a window and use the
      // File System Access API to read the content of the file entry.
    });
  }
});

Extensions with the fileBrowserHandler permission

Here are some popular browser extensions that use the "fileBrowserHandler" permission. To explore more, try our Advanced search.

Firefox Firefox add-ons with "fileBrowserHandler" permission

Permission Metrics

Popularity

Security Risk


Usage by Platform