completionId: cgen-1099a38dee794d9e9572a16ca3ae4f14
cgen-1099a38dee794d9e9572a16ca3ae4f14
This commit is contained in:
parent
d93fbab157
commit
a92d574c30
1 changed files with 12 additions and 4 deletions
16
index.html
16
index.html
|
|
@ -191,10 +191,10 @@
|
|||
|
||||
<!-- Discord SDK is imported in DiscordActivityContext.tsx from @discord/embedded-app-sdk npm package -->
|
||||
|
||||
<!-- Polyfill for crypto.randomUUID for compatibility -->
|
||||
<!-- Polyfill for crypto.randomUUID for compatibility - MUST run before any external scripts -->
|
||||
<script>
|
||||
if (!crypto.randomUUID) {
|
||||
crypto.randomUUID = function () {
|
||||
(function () {
|
||||
const randomUUID = function () {
|
||||
const array = new Uint8Array(16);
|
||||
crypto.getRandomValues(array);
|
||||
array[6] = (array[6] & 0x0f) | 0x40;
|
||||
|
|
@ -210,7 +210,15 @@
|
|||
hex.slice(10, 16).join(""),
|
||||
].join("-");
|
||||
};
|
||||
}
|
||||
|
||||
if (!crypto.randomUUID) {
|
||||
crypto.randomUUID = randomUUID;
|
||||
}
|
||||
if (!globalThis.crypto?.randomUUID) {
|
||||
if (!globalThis.crypto) globalThis.crypto = {};
|
||||
globalThis.crypto.randomUUID = randomUUID;
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
</head>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue