Skip to content

Conversation

@mike-w-kelly
Copy link

Changes tested locally with IE11 and open id connect (oidc.js)

Copy link
Owner

@andyperlitch andyperlitch left a comment

Choose a reason for hiding this comment

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

A few comments on this. Also I see that vendor-prefix msCrypto has been removed as of IE11: https://msdn.microsoft.com/en-us/library/dn302339(v=vs.85).aspx

index.js Outdated
var z = window.crypto.random(32);
for(t = 0; t < z.length; ++t)
rng_pool[rng_pptr++] = z.charCodeAt(t) & 255;
}
Copy link
Owner

Choose a reason for hiding this comment

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

You'll need to fix the indentation here (there should only be a few lines changed here).

index.js Outdated
rng_pool[rng_pptr++] = z.charCodeAt(t) & 255;
}
var crypto = window.crypto || window.msCrypto;
if(typeof window !== "undefined" && crypto) {
Copy link
Owner

Choose a reason for hiding this comment

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

It doesn't make sense to check for window being defined after the line you added which assumes it is there. You will need to set the crypto variable inside an if block like so:

if (typeof window !== "undefined") {
   var crypto = window.crypto || window.msCrypto;
   if (crypto.getRandomValues) {
     // ...

@mike-w-kelly
Copy link
Author

The vendor prefix is still present in IE11. In fact if you try MS own examples with IE11 https://msdn.microsoft.com/en-us/library/dn302324(v=vs.85).aspx you'll get the error I reported. If you add in the window.msCrypto as per my pull request it works correctly. I'm making the changes you requested, will push up shortly.

@mike-w-kelly
Copy link
Author

Changes made and pushed up.

@joshxyzhimself
Copy link

Hi, is this still a persistent issue for IE11?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants