Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion webcrypto-shim.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module.exports = function webcryptoShim (global) {
_SubtleCrypto = global.SubtleCrypto || _subtle.constructor || Object,
_CryptoKey = global.CryptoKey || global.Key || Object;

var isEdge = window.navigator.userAgent.indexOf('Edge/') > -1
var isEdge = global.navigator.userAgent.indexOf('Edge/') > -1

@dignifiedquire dignifiedquire Jan 14, 2017

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think global is defined in all browsers, maybe check for not being undefined in this order

  1. global
  2. window
  3. self

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

global is a local variable, it is the variable that is assigned to window or self.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should read the code I'm reviewing more closely :/

var isIE = !!global.msCrypto && !isEdge,
isWebkit = !!_crypto.webkitSubtle;
if ( !isIE && !isWebkit ) return;
Expand Down