From 0f126ce24175daa43cbffb478141ad0f8fff3cd1 Mon Sep 17 00:00:00 2001 From: Ivana Yovcheva Date: Mon, 19 Mar 2018 18:08:22 +0200 Subject: [PATCH] Fix crypto breaking error for IE11 window.crypto is throwing an error on IE11 which required a modification to use window.msCrypto instead in case of running on IE11 Signed-off-by: Ivana Yovcheva --- gateway/assets/script/bootstrap.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gateway/assets/script/bootstrap.js b/gateway/assets/script/bootstrap.js index b863c1ca..c56fe532 100644 --- a/gateway/assets/script/bootstrap.js +++ b/gateway/assets/script/bootstrap.js @@ -320,8 +320,9 @@ app.controller("home", ['$scope', '$log', '$http', '$location', '$interval', '$f ]); function uuidv4() { + var cryptoInstance = window.crypto || window.msCrypto; // for IE11 return ([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g, function(c) { - return (c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16) + return (c ^ cryptoInstance.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16) }) } \ No newline at end of file