-
Couldn't load subscription status.
- Fork 3k
Description
What problem are you trying to solve?
When switching between pages, the old page might want to customize the navigation experience, e.g. by displaying an exit animation or asynchronously preparing a view-transition.
What solutions exist today?
The developer can intercept the navigation (e.g. navigateEvent.intercept({precommitHandler}), and start a new navigation when they're ready.
However, this would create a slow end result as the cross-document navigation initiation is delayed.
How would you solve it?
There are two options as to how to resolve this:
- A generic
pageSwapEvent.waitUntil(promise), allowing the developer to defer commit as much as they want. - Provide some heuristics to particularly allow some animations to run until finish before committing.
Anything else?
This is different from #10997, where the "unload" actions are also valid for cross-origin navigations (e.g. an IndexedDB transaction). This is specific for in-app (same-origin) navigation customization.