Closed rviscomi closed 2 years ago
This PR writes the metrics state to local storage every time web-vitals.js reports a change. When the script is reinitialized, it attempts to read the persisted state from local storage. To distinguish from page reloads in the same tab, the state includes the navigationStart
time, which is ~unique for each tab+navigation.
I assume the local storage is temporary until the tab is closed, otherwise I'll need to add more code to delete state from storage. (can anyone confirm?)
LGTM
Fixes #101