We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e4a102a commit 6133bd2Copy full SHA for 6133bd2
frontend/src/ts/index.ts
@@ -49,6 +49,25 @@ import { getDevOptionsModal } from "./utils/async-modules";
49
import * as Sentry from "./sentry";
50
import * as Cookies from "./cookies";
51
52
+// Lock Math.random
53
+Object.defineProperty(Math, "random", {
54
+ value: Math.random,
55
+ writable: false,
56
+ configurable: false,
57
+ enumerable: true,
58
+});
59
+
60
+// Freeze Math object
61
+Object.freeze(Math);
62
63
+// Lock Math on window
64
+Object.defineProperty(window, "Math", {
65
+ value: Math,
66
67
68
69
70
71
function addToGlobal(items: Record<string, unknown>): void {
72
for (const [name, item] of Object.entries(items)) {
73
//@ts-expect-error dev
0 commit comments