Skip to content

Commit

Permalink
Changed all instances of the deprecated performance.timing.nagivation…
Browse files Browse the repository at this point in the history
…Start to performance.timeOrigin
  • Loading branch information
rthenhaus committed Aug 14, 2024
1 parent c46dc52 commit 82423e6
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion build/UserALEWebExtension/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ function timeStampScale(e) {
};
}
else if (delta > e.timeStamp) {
const navStart = performance.timing.navigationStart;
const navStart = performance.timeOrigin;
tsScaler = function (ts) {
return ts + navStart;
};
Expand Down
2 changes: 1 addition & 1 deletion build/UserALEWebExtension/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ function timeStampScale(e) {
};
}
else if (delta > e.timeStamp) {
const navStart = performance.timing.navigationStart;
const navStart = performance.timeOrigin;
tsScaler = function (ts) {
return ts + navStart;
};
Expand Down
2 changes: 1 addition & 1 deletion build/UserALEWebExtension/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ function timeStampScale(e) {
};
}
else if (delta > e.timeStamp) {
const navStart = performance.timing.navigationStart;
const navStart = performance.timeOrigin;
tsScaler = function (ts) {
return ts + navStart;
};
Expand Down
2 changes: 1 addition & 1 deletion build/userale-2.4.0.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/userale-2.4.0.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/userale-2.4.0.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion example/webpackUserAleExample/dist/main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/getInitialSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export function timeStampScale(e: Event): Settings.TimeFunction {
return e.timeStamp / 1000;
};
} else if (delta > e.timeStamp) {
const navStart = performance.timing.navigationStart;
const navStart = performance.timeOrigin;
tsScaler = function (ts) {
return ts + navStart;
};
Expand Down
4 changes: 1 addition & 3 deletions test/unit/spec/getInitialSettings.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,7 @@ describe("getInitialSettings", () => {
});
const e = { timeStamp: 1 } as Event;
const ts = timeStampScale(e);
expect(ts(e.timeStamp)).toBe(
performance.timing.navigationStart + e.timeStamp,
);
expect(ts(e.timeStamp)).toBe(performance.timeOrigin + e.timeStamp);
global.performance = originalPerformance;
});
});
Expand Down

0 comments on commit 82423e6

Please sign in to comment.