-
Couldn't load subscription status.
- Fork 42
added msCrypto for IE11 #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
added msCrypto for IE11 #19
Conversation
There was a problem hiding this 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; | ||
| } |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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) {
// ...|
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. |
|
Changes made and pushed up. |
|
Hi, is this still a persistent issue for IE11? |
Changes tested locally with IE11 and open id connect (oidc.js)