We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 918aad0 commit 774d7d2Copy full SHA for 774d7d2
apps/cookie-butler/static/js/core.js
@@ -29,7 +29,13 @@ class QRCodeHandler {
29
}
30
31
static generateUUID() {
32
- return crypto.randomUUID();
+ if (crypto && typeof crypto.randomUUID === 'function') {
33
+ return crypto.randomUUID();
34
+ } else {
35
+ return "10000000-1000-4000-8000-100000000000".replace(/[018]/g, c =>
36
+ (+c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> +c / 4).toString(16)
37
+ );
38
+ }
39
40
41
async _generateQRCode(url) {
0 commit comments