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

Crypto - check for browser support. AGJS-103 #92

Merged
merged 1 commit into from
Dec 5, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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