Support for WebWorker.

Signed-off-by: Tom Swindell <t.swindell@rubyx.co.uk>
This commit is contained in:
Tom Swindell 2017-01-14 12:45:52 +00:00
parent c45bdf602e
commit 98bc0bbc5f

View File

@ -10,5 +10,13 @@ module.exports = function getWebCrypto () {
} }
} }
if (typeof self !== 'undefined') {
require('webcrypto-shim')(self)
if (self.crypto) {
return self.crypto
}
}
throw new Error('Please use an environment with crypto support') throw new Error('Please use an environment with crypto support')
} }