Open chrisblakley opened 2 years ago
Another example:
navigation.addEventListener('navigate', (navigateEvent) => {
switch (navigateEvent.destination.url) {
case 'https://example.com/':
navigateEvent.transitionWhile(loadIndexPage());
break;
case 'https://example.com/cats':
navigateEvent.transitionWhile(loadCatsPage());
break;
}
});
https://developer.chrome.com/docs/web-platform/navigation-api/
Awaiting both Firefox and Safari as of July 2023.
...when it is available.