calvinmetcalf / crypto-pouch

plugin for encrypted pouchdb/couchdb databases
MIT License
243 stars 43 forks source link

Chromium Error: secure random number generation not supported by this browser use chrome, FireFox or Internet Explorer 11 #12

Closed lari closed 3 years ago

lari commented 9 years ago

Hello, I'm trying to use the browserified version with nw.js (node-webkit) and getting the following error:

Error: secure random number generation not supported by this browser
use chrome, FireFox or Internet Explorer 11
    at Object.oldBrowser (file:///Users/lari/<app_folder>/node_modules/crypto-pouch/bundle.js:19851:9)
    at Object.encrypt [as incoming] (file:///Users/lari/<app_folder>/node_modules/crypto-pouch/bundle.js:19937:24)
    at incoming (file:///Users/lari/<app_folder>/node_modules/crypto-pouch/bundle.js:17274:21)
    at handlers.bulkDocs (file:///Users/lari/<app_folder>/node_modules/crypto-pouch/bundle.js:17323:22)
    at callHandlers (file:///Users/lari/<app_folder>/node_modules/crypto-pouch/bundle.js:18500:17)
    at i.bulkDocs (file:///Users/lari/<app_folder>/node_modules/crypto-pouch/bundle.js:18245:12)
    at file:///Users/lari/<app_folder>/src/services.js:84:12
    at file:///Users/lari/<app_folder>/bower_components/angular/angular.min.js:119:113
    at n.$eval (file:///Users/lari/<app_folder>/bower_components/angular/angular.min.js:133:221)
    at n.$digest (file:///Users/lari/<app_folder>/bower_components/angular/angular.min.js:130:233),
source: file:///Users/lari/<app_folder>/bower_components/angular/angular.min.js (107)

Using version 1.1.3 and tried with nw.js v0.12.3: (IO.js v1.2.0, Chromium 41.0.2272.76) and node-webkit v0.11.6 (Node v0.11.13, Chromium 38.0.2125.104).

So chromium doesn't support crypto?

Any help on solving this very much appreciated.

You might ask why I cannot just use the node version, since I'm running it on nw.js. Well, the dependencies go so deep that on Windows I'm getting "path too long" errors.

lari commented 9 years ago

Got this solved for now by bundling my services.js with browserify so that it includes all the node modules:

browserify --node services.js -o services.bundle.js

This way I can keep using crypto-pouch as a node module with nw.js but I actually don't need to include the node_modules directory at all in the release version, so it won't cause any "too long path" errors any more on Windows.

I'll still leave this open until somebody decides, whether the actual issue can be solved within this plugin or should be solved either in Chromium or nw.js.

garbados commented 3 years ago

Closing this issue since it's been a while and the code has changed a lot. @lari please let me know if you still need help :)