Declaration of use
Ethically I feel that sites using this concept have a duty to declare that user's CPU power is being siphoned off in this way. What happens if you leave your browser on a page that does mining, will the page force keep-alive to continue mining? If your connection is metered then effectively you've just poured your money into the miner's coffers.
You're also going to get the situation where several mining operations will be taking place at the same time, which will kill normal work. Miner's will do well to enforce a "one browser, one mining session" limit before they attract bad publicity.