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
This commit is contained in:
Evadne Wu 2017-05-06 16:13:54 +02:00
parent 50d026fbda
commit 50af2284aa
No known key found for this signature in database
GPG Key ID: EE6145BB00D35823

View File

@ -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: {