v160 · capabilities (fugu) · launch handling

Workspace router

The use case from the developer report that motivated the change (manifest-incubations #141): a document app uses focus-existing so relaunching never spawns duplicate windows — but when the launched URL is a different notebook, it should get its own window. That takes window.open(), which needs activation. Chrome 160 hands the consumer that activation; older builds had to fall back to an in-app “open in new window?” prompt.

Status: on by default in Chrome 160 (kill switch: --disable-features=WebAppLaunchHandlerUserActivation). Real routing of launches needs this concept installed as an app; app shortcuts Open notebook A/B/C are the launch triggers. In a tab, the route buttons drive the same router from a real click or after activation has expired.

Where this page is running

This window’s workspace

Router idle. Deliver a launch for another notebook.

Drive the router

As a real launch (installed app): right-click the app icon → Open notebook B, or from a browser tab click ?doc=b / ?doc=c with link capturing on.

Tab baselines (same router function, not a launch):

the router

launchQueue.setConsumer((params) => {
  const hasActivation = navigator.userActivation.isActive;   // Chrome 160+: true
  const doc = new URL(params.targetURL).searchParams.get("doc");
  if (doc === currentDoc) return focusInPlace();             // same doc: no new window
  if (hasActivation) {
    const w = window.open(params.targetURL, "_blank");       // different doc: own window
    if (w) return;
  }
  showOpenInNewWindowPrompt(params.targetURL);               // pre-160 fallback, still needed
});

The opened URL carries &spawned=1 and the router never re-opens a spawned URL — a guard against link capturing routing the new window’s URL straight back into this one.

see also