completionId: cgen-edfe33e2231a4ed7aea8049819ca2464
cgen-edfe33e2231a4ed7aea8049819ca2464
This commit is contained in:
parent
aaac82137c
commit
9e63061e45
1 changed files with 22 additions and 0 deletions
22
index.html
22
index.html
|
|
@ -190,6 +190,28 @@
|
|||
</script>
|
||||
|
||||
<!-- Discord SDK is imported in DiscordActivityContext.tsx from @discord/embedded-app-sdk npm package -->
|
||||
|
||||
<!-- Polyfill for crypto.randomUUID for compatibility -->
|
||||
<script>
|
||||
if (!crypto.randomUUID) {
|
||||
crypto.randomUUID = function () {
|
||||
const array = new Uint8Array(16);
|
||||
crypto.getRandomValues(array);
|
||||
array[6] = (array[6] & 0x0f) | 0x40;
|
||||
array[8] = (array[8] & 0x3f) | 0x80;
|
||||
const hex = Array.from(array).map((b) =>
|
||||
b.toString(16).padStart(2, "0")
|
||||
);
|
||||
return [
|
||||
hex.slice(0, 4).join(""),
|
||||
hex.slice(4, 6).join(""),
|
||||
hex.slice(6, 8).join(""),
|
||||
hex.slice(8, 10).join(""),
|
||||
hex.slice(10, 16).join(""),
|
||||
].join("-");
|
||||
};
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
|
|
|||
Loading…
Reference in a new issue