As noted in #346, we could support wasm32-unknown-unknown on web when the js feature is enabled. The major problem is was (see next comment) what to do when the custom backend is also enabled:
Defaulting to the custom backend is not okay: any crate in the dependency tree could overwrite the (secure) random source used by a binary. No longer true: the user must the the getrandom_backend cfg.
- Defaulting to the
js backend is not okay: many crates depend on getrandom with the js feature for convenience, which would prevent support for a custom backend (no longer true; see next comment).
Updated suggestion in next comment.
Original suggestion
We could instead consider this a compiler error. This deviates significantly from standard usage of features which should be additive (i.e. any combination including all of them is valid).
Nevertheless, this might be workable. Any crate which could possibly be used on a non-web wasm32-unknown-unknown platform depending on getrandom with feature js would be a bug, forcing these crates not to do so (or to explicitly not support non-web wasm32-u-u targets).
This is (I believe) the simplest solution for wasm32-u-u which doesn't block getrandom from supporting non-web targets.