Merge pull request #65 from dryajov/master

feat: change window to self for webworker support
This commit is contained in:
Friedel Ziegelmayer 2017-02-07 20:45:01 +01:00 committed by GitHub
commit 19c6ce7c06

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
} }
} }