v146 · Web APIs · Reload Behavior Demo
Reload Behavior Demo
Observes the launchQueue consumer and logs every time it fires. In Chrome 146+, the consumer only fires on actual launches — not on page reloads.
This is a simulation. Real
LaunchParams only arrive when a PWA is launched from the OS file association or a launch URL. This demo simulates a launch by injecting synthetic params and tracks whether the consumer fires across navigations.
consumer status
consumer fired (this page load)
0 times
last params received
none
event log
INFO
Page loaded — waiting for launchQueue consumer to fire
consumer code
if ('launchQueue' in window) {
launchQueue.setConsumer(async launchParams => {
// Chrome 146+: fires ONLY on actual launches
// NOT on reload — reloads produce no LaunchParams
console.log('targetURL:', launchParams.targetURL);
for (const handle of launchParams.files) {
const file = await handle.getFile();
await openInEditor(file);
}
});
}
launchQueue.setConsumer(async launchParams => {
// Chrome 146+: fires ONLY on actual launches
// NOT on reload — reloads produce no LaunchParams
console.log('targetURL:', launchParams.targetURL);
for (const handle of launchParams.files) {
const file = await handle.getFile();
await openInEditor(file);
}
});
}
what to observe
- Click Simulate launch — the consumer fires and logs the synthetic params.
- Click Reload page — in Chrome 146+, the consumer does not fire again. The fire count stays at 0 on the reloaded page.
- Before Chrome 146: a reload after a real file-handling launch would re-deliver the original
LaunchParams, causing the consumer to fire with stale file handles.