It will be good if the site will be upfront in saying that they use a system that momentarily uses our computing power whenever we're on their site in replacement for annoying ads that usually take up much of the space of the website UI. Unfortunately, most of these websites inject these malware into our systems without even telling us about it. I had an issue once that an 'unknown process' is eating up 97% of my GPU's performance for 30 minutes, on idle mode. Turns out it was a mining software embedded in one of the files I needed for a USB microscope (lol beware guys). From then on, I always check sources, see what's in the package before I install anything on my machine.
As I am aware most modern versions of browsers try to block some of those well-known mining scripts.
It is only those that ask for the permission from the user that they don't automatically block.