v146 · Web APIs · Before/After Comparison
Before/After Comparison
Side-by-side view of the old behaviour — consumer re-fires on reload — versus the Chrome 146 fix where reload is treated as a clean page load with no queued LaunchParams.
consumer firing: old vs new
Before Chrome 146 (buggy)
- FIRES Initial launch from OS file association
- FIRES Page reload after file-handling launch
- FIRES Multiple reloads — each one re-queues original params
- FIRES Hard reload (Ctrl+Shift+R) after launch
Problem: stale file handles and params from the original launch re-delivered on every reload — file-handling code runs unexpectedly, file handles may already be closed.
Chrome 146+ (fixed)
- FIRES Initial launch from OS file association
- SILENT Page reload after file-handling launch
- SILENT Subsequent reloads — no params to re-queue
- SILENT Hard reload after launch
Fix: reload = fresh page load.
LaunchParams are consumed once, never stored for re-delivery. Consumer only fires on genuine launches.
lifecycle: file launch then reload
-
1
User opens
report.csvfrom the OS — browser launches the PWA with a file association -
2
launchQueue.setConsumer()fires —LaunchParams.filescontains the file handle; PWA reads and opens the file -
3
Pre-146 only: user reloads the page → Chrome re-queues the original
LaunchParams→ consumer fires again with the same (now possibly expired) file handle - 3 Chrome 146+: user reloads the page → browser treats it as a new page load → consumer does not fire → file-handling code stays idle
code implications
// ✓ Standard pattern — works correctly in Chrome 146+
if ('launchQueue' in window) {
launchQueue.setConsumer(async launchParams => {
for (const handle of launchParams.files) {
const file = await handle.getFile();
await openInEditor(file);
}
});
}
// If you relied on reload-retrigger to survive page refreshes (rare),
// use sessionStorage to persist launch state across reloads instead:
launchQueue.setConsumer(async launchParams => {
// Store metadata (not handles — those can't be serialised)
const names = launchParams.files.map(h => h.name);
sessionStorage.setItem('pendingFiles', JSON.stringify(names));
// Process files from the actual live handles immediately
for (const handle of launchParams.files) {
const file = await handle.getFile();
await openInEditor(file);
}
});
// On next page load (e.g. after reload) you can show UI
// based on the stored names — but re-open via your own
// logic, not by re-reading launchParams (won't arrive).
see also
scenario focus
Select a scenario to focus its rendered example and summary.