Skip to content

Measuring beforeunload #190

Open
Open
@yoavweiss

Description

@yoavweiss

The current timeorigin is set when a the navigation request fetch starts, in between beforeunload and the unload event. As a result of that, there's some a timespan between the hardware timestamp of the user's interaction that navigates away and the next navigation that's kinda hard to measure today, even on the same origin.

Arguably, this is measurable using LT/LoAF+EventTiming, but if the user's navigation is delayed on main thread activity that delays the click event or the beforeunload event or the event handlers themselves, that's unlikely to be captured by a PerformanceObserver before the page navigates away.

Given that, it seems like we could measure the last click HW timestamp -> next nav fetch or unload as a separate measurement. How we report it may be tricky though. A few options:

  • We could use the Reporting API to report those timestamps.
  • PendingBeacon (or whatever we end up calling it) could report that timestamp when available. That would be a change from current thinking about the beacon data itself be completely userland-driven.
  • something else??

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions