Restore ReadingDepth instrument
This restores the ReadingDepth instrumentation which is intended to only
run on the Minerva and Vector skins.
This reverts commit 2bc5048d7b3c2f7e290dcad3a72938fec54c9b2f.
with some manual rebases.
- Switches to the native beforeunload event from the jquery
- mw.track replaced with mw.eventLog
- EVENT.$schema is added
- Switch to hyphens for event names
- Uses performance.now API instead of the mw.now() API
- Uses the PerformanceNavigationTiming API instead of the now
deprecated PerformanceTiming API.
- Changes how the total_length field is defined/implemented.
Previously the timer for total_length started at first paint if
available and otherwise used domInteractive as its starting point.
This implementation's timer for total_time starts at the moment that
the visibility change listener is added.
- Changes how the visible_length field is defined/implemented. The
previous implementation's visibleLength field subtracted the
difference between firstPaint and domInteractive from the recorded
msPaused value. This implementation's visible_length field is
strictly equal to total_length - msPaused.
- Removes pageTitle and pageToken fields for privacy reasons.
- Adds page_length and access_method fields per request of data