designcourse icon indicating copy to clipboard operation
designcourse copied to clipboard

proposal: add an additional 'final unloading' page exist observable

Open janeklb opened this issue 3 years ago • 1 comments
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.

janeklb avatar Nov 18 '22 12:11 janeklb

CLA assistant check
All committers have signed the CLA.

bits-bot avatar Nov 18 '22 12:11 bits-bot