fileSystemProvider

The fileSystemProvider permission allows a ChromeOS extension to create virtual file systems that are accessible from the ChromeOS Files app.

This is a ChromeOS-only permission.

What it does

  • Grants access to the chrome.fileSystemProvider API.
  • Enables an extension to act as a "provider" for a file system.
  • The extension can expose a file hierarchy (directories and files) that is then displayed in the left-hand navigation of the Files app, alongside "Google Drive" and "Downloads".
  • The extension is responsible for handling all file operations, such as reading directories, getting file metadata, and reading/writing file content.

When to use it

This is for extensions that integrate cloud storage services or other remote file systems into ChromeOS.

Examples:

  • An extension that provides access to a user's Dropbox or OneDrive account directly within the Files app.
  • A developer tool that mounts a remote SFTP server as a local file system.
  • A custom file-syncing service.

Manifest Declaration

{
  "name": "My Cloud Storage Provider",
  "version": "1.0",
  "manifest_version": 3,
  "permissions": [
    "fileSystemProvider"
  ],
  "file_system_provider_capabilities": {
    "configurable": false,
    "watchable": false,
    "multiple_mounts": true,
    "source": "network"
  },
  "background": {
    "service_worker": "background.js"
  }
}

The file_system_provider_capabilities manifest key is required for an extension to register as a file system provider. source declares where the data comes from ("file", "device", or "network"); the boolean flags advertise whether mounts can be reconfigured, watched for changes, or stacked.

Security & Privacy

Why is it risky?

This permission (only for ChromeOS) lets an extension add a new "drive" to your file manager, like a Dropbox or a network server. When you use this new drive, the extension is responsible for handling all the files.

The risk is that a malicious extension could misuse the files you upload or open. For example, it could send a copy of your files to a hacker's server. You should only use file providers from companies you trust with your data. The extension cannot access your local files or your Google Drive; it can only manage files within its own virtual drive.

API Usage Example

The API is complex and event-driven. The extension must respond to a series of events from the Files app. This is a highly simplified conceptual example.

// background.js

// When the user requests to mount our file system
chrome.fileSystemProvider.onMountRequested.addListener((options, successCallback, errorCallback) => {
  // Perform authentication or setup here...
  console.log(`Mounting file system with ID: ${options.fileSystemId}`);
  successCallback();
});

// When the Files app asks for the contents of a directory
chrome.fileSystemProvider.onReadDirectoryRequested.addListener((options, successCallback, errorCallback) => {
  console.log(`Reading directory: ${options.directoryPath}`);
  // In a real app, you would fetch this from your cloud service
  const entries = [
    { isDirectory: false, name: 'document.txt', mimeType: 'text/plain' },
    { isDirectory: true, name: 'My Folder', mimeType: '' }
  ];
  successCallback(entries, false /* hasMore */);
});

// When the Files app asks to read a file's content
chrome.fileSystemProvider.onReadFileRequested.addListener((options, successCallback, errorCallback) => {
  console.log(`Reading file: ${options.filePath}`);
  // Fetch the file content from your service
  const content = new ArrayBuffer(/* file data */);
  successCallback(content, false /* hasMore */);
});

// Mount the filesystem programmatically. `fileSystemId` must be unique
// within this extension and is required.
chrome.fileSystemProvider.mount({
  fileSystemId: "my-cloud-service",
  displayName: "My Cloud Service",
  writable: true
});

Extensions with the fileSystemProvider permission

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

Firefox Firefox add-ons with "fileSystemProvider" permission

Permission Metrics

Popularity

Security Risk


Usage by Platform