From 20bbf4746dcf5a557a2f482feddf507a2817c577 Mon Sep 17 00:00:00 2001 From: Simon Legg Date: Mon, 10 Apr 2017 16:12:54 +0100 Subject: [PATCH] Update ctm.html --- browser/layout/partials/ctm.html | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/browser/layout/partials/ctm.html b/browser/layout/partials/ctm.html index 7ddd90887..ded4efad5 100644 --- a/browser/layout/partials/ctm.html +++ b/browser/layout/partials/ctm.html @@ -3,10 +3,9 @@ classes = classes.replace(/\bno-js\b/, 'js'); {{!note: needed for JS that's run out of the scope of the bootstrap (inline onclicks, etc)}} var getRandomValuesAvailable; -try { - getRandomValuesAvailable = 'getRandomValues' in window.crypto -} catch (e) { - getRandomValuesAvailable = 'getRandomValues' in window.msCrypto +var cryptoApi = window.crypto || window.msCrypto; +if (cryptoApi) { + getRandomValuesAvailable = 'getRandomValues' in cryptoApi; } window.cutsTheMustard = (