make crypto.getRandomValues available on IE11 without a prefix

olm needs this to work on IE11
This commit is contained in:
Bruno Windels 2020-08-27 13:31:14 +02:00
parent fe0257bca1
commit 87aabb3057

View file

@ -37,6 +37,11 @@ function addScript(src) {
} }
async function loadOlm(olmPaths) { async function loadOlm(olmPaths) {
// make crypto.getRandomValues available without
// a prefix on IE11, needed by olm to work
if (window.msCrypto && !window.crypto) {
window.crypto = window.msCrypto;
}
if (olmPaths) { if (olmPaths) {
if (window.WebAssembly) { if (window.WebAssembly) {
await addScript(olmPaths.wasmBundle); await addScript(olmPaths.wasmBundle);