I saw an addon for Firefox that does that a couple days ago. I think you can do the same thing with filters in uBlock Origin though, but if you don't use an adblocker, it might be useful.
How would such a plugin work? Say you're visiting a webpage with lots of graphical effects that require lots of computation. How would the blocker distinguish those computations from mining?