Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: return fake version for performance.timeOrigin #515

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rriski
Copy link

@rriski rriski commented Dec 3, 2024

Fixes #514

Purpose (TL;DR) - mandatory

Return valid value for performance.timeOrigin instead of NOOP. This fixes an issue in tests that depend on performance.timeOrigin having a valid value.

Background (Problem in detail) - optional

See #514

Solution - optional

Set performance.timeOrigin to a dummy value. I'm not sure if 0 is better than setting the value to clock.now. When testing performance.timeOrigin in Chrome Console I can see that the value is set to the timestamp when the window was opened:

> globalThis.performance.timeOrigin
1733227796841

There is further information in MDS docs on how the value is supposed to be set: https://developer.mozilla.org/en-US/docs/Web/API/Performance/timeOrigin#value

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support performance.timeOrigin property
1 participant