Skip to content
This repository has been archived by the owner on Dec 5, 2019. It is now read-only.

Commit

Permalink
Crypto - check for browser support. AGJS-103
Browse files Browse the repository at this point in the history
  • Loading branch information
lholmquist committed Dec 5, 2013
1 parent 3754b6d commit a226843
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/crypto/aerogear.crypto.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
*/
AeroGear.Crypto = function() {

if( !window.crypto || !window.crypto.getRandomValues ) {
throw "Your browser does not support the Web Crypto API";
}

// Allow instantiation without using new
if ( !( this instanceof AeroGear.Crypto ) ) {
return new AeroGear.Crypto();
Expand Down

0 comments on commit a226843

Please sign in to comment.