Can you actually use WebGL for this? I mean, don't you need a user-visible graphics context? That's a serious question, I have used WebGL only once in my life and that was years ago.
On the other hand, WebGPU looks exactly like the kind of technology that would make web-based GPU-enabled bitcoin mining realistic.