kernel-swarm/polyfill.js

12 lines
253 B
JavaScript
Raw Normal View History

2023-04-04 10:08:30 +00:00
import { Crypto } from "@peculiar/webcrypto";
let globalCrypto = self.crypto;
if (!globalCrypto.subtle) {
let subtleCrypto = new Crypto().subtle;
Object.defineProperty(globalCrypto, "subtle", {
get() {
return subtleCrypto;
},
});
}