From 50af2284aaa3352464dac203850fe89753a96a85 Mon Sep 17 00:00:00 2001 From: Evadne Wu Date: Sat, 6 May 2017 16:13:54 +0200 Subject: [PATCH] amends Babel cache (#8364) implementation to disable caching on Safari - the viewer was not loading in development mode on Safari, due to Safari having crypto.webkitSubtle instead of crypto.subtle. - the isCachingPossible check was amended to check for crypro.subtle which is currently not in Safari but in Firefox and Chrome. This essentially works around the issue by disabling caching for Safari in development mode. - maintainer sentiment: people who develop on Safari can get this speedup once Safari drops prefix for SubtleCrypto. - note: at time of writing Safari Version 10.1 (12603.1.30.0.34) has an issue where caching can be enabled for PDF.js but must to be disabled for worker, otherwise the two sides do not communicate. - https://github.com/mozilla/pdf.js/pull/8387#issuecomment-299709961 - https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/digest --- systemjs.config.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/systemjs.config.js b/systemjs.config.js index 4d88c1eb4..e4c2dde77 100644 --- a/systemjs.config.js +++ b/systemjs.config.js @@ -36,7 +36,8 @@ var isCachingPossible = typeof indexedDB !== 'undefined' && typeof TextEncoder !== 'undefined' && - typeof crypto !== 'undefined'; + typeof crypto !== 'undefined' && + typeof crypto.subtle !== 'undefined'; SystemJS.config({ packages: {