Skip to content

Commit

Permalink
Add support for crypto from globalThis.
Browse files Browse the repository at this point in the history
  • Loading branch information
evanvosberg committed Nov 19, 2020
1 parent 7f36db9 commit 971c31f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ var CryptoJS = CryptoJS || (function (Math, undefined) {
crypto = self.crypto;
}

// Native crypto from worker
if (typeof globalThis !== 'undefined' && globalThis.crypto) {
crypto = globalThis.crypto;
}

// Native (experimental IE 11) crypto from window (Browser)
if (!crypto && typeof window !== 'undefined' && window.msCrypto) {
crypto = window.msCrypto;
Expand Down

0 comments on commit 971c31f

Please sign in to comment.