12 lines
253 B
JavaScript
12 lines
253 B
JavaScript
|
import { Crypto } from "@peculiar/webcrypto";
|
||
|
|
||
|
let globalCrypto = self.crypto;
|
||
|
if (!globalCrypto.subtle) {
|
||
|
let subtleCrypto = new Crypto().subtle;
|
||
|
Object.defineProperty(globalCrypto, "subtle", {
|
||
|
get() {
|
||
|
return subtleCrypto;
|
||
|
},
|
||
|
});
|
||
|
}
|