From e02b0730dcab64cab8284f535b23e391687ba3fc Mon Sep 17 00:00:00 2001 From: Xelio Date: Wed, 8 May 2013 21:27:41 +0800 Subject: [PATCH] Plugin Sync: Fix bug where Firefox has window.crypto but not window.crypto.getRandomValues --- plugins/sync.user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/sync.user.js b/plugins/sync.user.js index cfd15cce..91b106da 100644 --- a/plugins/sync.user.js +++ b/plugins/sync.user.js @@ -419,7 +419,7 @@ window.plugin.sync.searchFileOrFolder = function(queryOption, callback) { // http://stackoverflow.com/a/7221797/2322660 // With format fixing: xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx where y in [8,9,a,b] window.plugin.sync.generateUUID = function() { - if(window.crypto) { + if(window.crypto && window.crypto.getRandomValues) { var buf = new Uint16Array(8); window.crypto.getRandomValues(buf); var S4 = function(num) {