3 ms·
There are valid use cases however the issue is rooted in lacking browser APIs. For instance, - if you want to do statistics tracking (how many hits your site
by apatheticonion 6mo ago
There are valid use cases however the issue is rooted in lacking browser APIs.
For instance,
- if you want to do statistics tracking (how many hits your site gets and user journeys)
- You have a widget/iframe system that needs to teardown when the SPA page is navigated away
- etc
The browser does not have a;
globalThis.history.addEventListener('navigate')
So you must monkey patch the history API. It's impractical from a distribution standpoint to embed this code in the page bundle as it's often managed externally and has its own release schedule.
- friendzis 6mo ago> - if you want to do statistics tracking (how many hits your site gets and user journeys) You can do all of that server-side and much more reliably at that. The only reason to do any of this tracking client-side is advertisers trusting fake number go up more than sales numbers.
- jampekka 6mo agoBrowsers now have window.navigation.addEventListener("navigate") that allows just this. https://developer.mozilla.org/en-US/docs/Web/API/Navigation/navigate_event https://developer.mozilla.org/en-US/docs/Web/API/Navigation/...
- apatheticonion 6mo agoHuh! Well I'll be