WIP: use self instead of window for WebWorker compatibility

This commit is contained in:
dryajov 2017-01-31 02:09:46 -08:00
parent 308ac7cd1a
commit 843b5e33d6

View File

@ -3,12 +3,12 @@
'use strict' 'use strict'
module.exports = function getWebCrypto () { module.exports = function getWebCrypto () {
if (typeof window !== 'undefined') { if (typeof self !== 'undefined') {
// This is only a shim for interfaces, not for functionality // This is only a shim for interfaces, not for functionality
require('webcrypto-shim')(window) require('webcrypto-shim')(self)
if (window.crypto) { if (self.crypto) {
return window.crypto return self.crypto
} }
} }