demo · v144
waitUntil Sandbox
Trigger a view transition and inject a deferred-work promise via the new waitUntil() method. The timeline below shows when the transition starts, when the extra work resolves, and when finished settles. Compare with and without the waitUntil() call.
startViewTransition:checking…
waitUntil method:checking…
scene A
the API
const t = document.startViewTransition(() => updateDOM());
t.waitUntil(loadDeferredAssets()); // NEW in Chrome 144
await t.finished; // does not resolve until both DOM and deferred work complete