manifest: file_handlers support
Published
manifest: file_handlers — The file_handlers member registers an installed PWA with
the operating system as a handler for specific file types, so the OS can launch the PWA
when the user opens a matching file. The app receives the file via window.launchQueue.
Browser & ecosystem support
Section titled “Browser & ecosystem support”- Legend
- Yes
- Partial
- Flag
- No
- Unknown
| Browser / Platform | Support | Versions | Confidence | Source | Notes |
|---|---|---|---|---|---|
| Chrome (Desktop) | Yes | 102 | high | source | — |
| Chrome (Android) | No | — | high | source | 1 |
| Edge (Desktop) | Yes | 102 | high | source | 2 |
| Firefox (Desktop) | No | — | high | source | 3 |
| Firefox (Android) | No | — | high | source | 45 |
| Safari (macOS) | No | — | high | source | 6 |
| Safari (iOS) | No | — | high | source | 78 |
| Samsung Internet | No | — | high | source | 910 |
| WebView (Android) | No | — | high | source | 1112 |
- No Chrome Android support is recorded in browser-compat-data.
- Derived by browser-compat-data mirroring from Chrome.
- No Firefox support is recorded in browser-compat-data.
- No Firefox for Android support is recorded in browser-compat-data.
- Derived by browser-compat-data mirroring from Firefox.
- No Safari support is recorded in browser-compat-data.
- No Safari on iOS support is recorded in browser-compat-data.
- Derived by browser-compat-data mirroring from Safari.
- No Samsung Internet support is recorded in browser-compat-data.
- Derived by browser-compat-data mirroring from Chrome Android.
- No WebView Android support is recorded in browser-compat-data.
- Derived by browser-compat-data mirroring from Chrome Android.
Per Chrome for Developers, file handling “is limited to desktop operating systems” in Chromium’s implementation — do not rely on it to register file associations on Android.
Consuming a launched file
Section titled “Consuming a launched file”Per MDN’s file_handlers reference, the app receives the launched file through
window.launchQueue.setConsumer():
async function playSong(fileHandle) { const blob = await fileHandle.getFile(); const url = URL.createObjectURL(blob); new Audio(url).play();}
function supportsFileHandling() { return "launchQueue" in window && "files" in LaunchParams.prototype;}
if (supportsFileHandling()) { window.launchQueue.setConsumer(({ files }) => { if (files && files.length) { playSong(files[0]); } });}Detecting support and falling back
Section titled “Detecting support and falling back”Per Chrome for Developers, feature detection for File Handling checks two conditions —
"launchQueue" in window and "files" in LaunchParams.prototype — since launchQueue
alone doesn’t confirm the files parameter shape the app depends on. Guard the consumer
with both checks, and give users an in-app way to open a file when that OS launch path
isn’t available:
if (supportsFileHandling()) { window.launchQueue.setConsumer(({ files }) => { if (files && files.length) { playSong(files[0]); } });} else { // No file-handling support here — fall back to a manual <input type="file"> picker // in the UI instead of relying on OS-level file association. document.getElementById("open-file-input").hidden = false;}What goes wrong
Section titled “What goes wrong”-
file_handlersis desktop-only in Chromium, per Chrome for Developers — do not expect the OS-level “Open with” flow to reach the app on Android. - Feature-detect with both
"launchQueue" in windowand"files" in LaunchParams.prototype, per Chrome for Developers — checkinglaunchQueuealone doesn’t confirm thefilesparameter shapesetConsumer()callbacks depend on. - Firefox and Safari do not implement
file_handlers, per the compatibility data above — always ship an in-app file picker that doesn’t depend on OS registration.
Where to go next
Section titled “Where to go next”- manifest: shortcuts support — another manifest member browsers add for installed PWAs.
- manifest:
shortcuts— the reference entry for the same install-time capability.
← Back to the Compatibility explorer.