How do Javascript-based wallets generate random numbers and is this cryptographically secure?
Most modern browsers provide a native crypto api accessible through the window.crypto object.

https://developer.mozilla.org/en-US/docs/DOM/window.crypto

It is also possible to seed random values using mouse movements and key presses.