You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This sample demonstrates file handling in an extension.
4
+
5
+
## Overview
6
+
7
+
On ChromeOS only, extensions can use the `file_handlers` manifest key to
8
+
register as a file handler for particular file types. This behaves in a similar way to the
9
+
[equivalent key](https://developer.mozilla.org/docs/Web/Manifest/file_handlers) in web
10
+
applications. As with web applications, you use the [Launch Handler API](https://developer.mozilla.org/en-US/docs/Web/API/Launch_Handler_API) to open and process a file.
11
+
12
+
This extension lets you open text files and see their name and size on the opened extension page. This could be a good starting point for building an extension that displays or interacts with an opened file.
13
+
14
+
<imgsrc="screenshot.png"height=300alt="Screenshot showing the File Handling API demo running in Chrome.">
15
+
16
+
## Running this extension
17
+
18
+
**This API is only supported on ChromeOS**.
19
+
20
+
1. Clone this repository.
21
+
2. Load this directory in Chrome as an [unpacked extension](https://developer.chrome.com/docs/extensions/mv3/getstarted/development-basics/#load-unpacked).
22
+
3. Create a text file on your ChromeOS device.
23
+
4. In the Files app, select the file.
24
+
5. In the toolbar, choose "Open" and then "File Handling Demo".
0 commit comments