designcourse
designcourse copied to clipboard
proposal: add an additional 'final unloading' page exist observable
trafficstars
Motivation
Any data sent by clients from their own registered beforeunload listeners will not make it into the intake because this library's beforeunload listener is registered first and therefore executes first.
Changes
Send an additional page exit event (with a new reason: 'final_before_unload') from a setTimeout(..., 0) (seems like the best option since process.nextTick is not available in browsers, and setImmediate is not widely available in browers either).
This will result is a "best effort" of sending more data, but it's still possible to not catch everything
Testing
Not done any yet -- this is just a proposal
- [ ] Local
- [ ] Staging
- [ ] Unit
- [ ] End to end
I have gone over the contributing documentation.