Skip to content

Commit

Permalink
Use vendor-prefixed msCrypto property for IE 11
Browse files Browse the repository at this point in the history
Together with [1] this fixes the OAuth popup failing to appear when
clicking "Log in" in IE 11.

[1] #537
  • Loading branch information
robertknight committed Sep 11, 2017
1 parent 2e7de2e commit eb393fd
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/sidebar/util/random.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ function byteToHex(val) {
* @return {string}
*/
function generateHexString(len) {
var crypto = window.crypto || window.msCrypto /* IE 11 */;
var bytes = new Uint8Array(len / 2);
crypto.getRandomValues(bytes);
return Array.from(bytes).map(byteToHex).join('');
Expand Down

0 comments on commit eb393fd

Please sign in to comment.