Interesting, just noticed that watching a Udemy course uses %98 CPU (in Activity Monitor on a MBP). This even if playback if paused. Wonder if they're doing something similar or it's just a lame implementation?
Sometimes I want some pages (or even iframes in those pages) consume my CPU and be as smooth as possible.
We used to do something like that with Flash: make the user click it if they want it to run.
Hopefully a more sophisticated solution which requires or measures GPU usage to UX updates may be better.
WebGL games and heavy animations can run on the GPU, but if they aren't updating the interface, perhaps that can be used to find something nefarious
Designers and developers need to understand that allowing them to run their code on my computer is a privilege, not an absolute right. As every right, it must not be abused. If it's abused, it will be terminated. Google finding and disabling these Coinhive miners on YT is just treating the symptoms, not the root cause.