From 87aabb30579136593bbce306cdd61aac5edd2621 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Thu, 27 Aug 2020 13:31:14 +0200 Subject: [PATCH] make crypto.getRandomValues available on IE11 without a prefix olm needs this to work on IE11 --- src/main.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main.js b/src/main.js index 85274948..79f5698d 100644 --- a/src/main.js +++ b/src/main.js @@ -37,6 +37,11 @@ function addScript(src) { } 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 (window.WebAssembly) { await addScript(olmPaths.wasmBundle);