Earlier quoted context omitted.
Nobody would mine bitcoin in the browser in their right mind, it's a waste of resources. You would choose one of the coins made specifically for CPU/GPU mining only, no ASICs.
Mining doesn't have to be a cost efficient use of cpu cycles for the person browsing for this to catch on, it just needs to be a more cost efficient use of bandwidth and server power for the entity serving the ads. Bitcoins are the consistently valuable and liquid coin, therefore it can make sense to serve bitcoin mining js.
Why? Because each desktop CPU would only yield 20-30 megahashes per second, less if you don't want to slow the user's computer to a crawl. A server would need to manage millions of clients just to match a single ASIC miner which has efficiency rated in terahashes. And that amount of hash power would only return about 30 dollars in bitcoin on a good day.
This is why all javascript miners target Monero and the latter was often criticised for having a CPU-friendly PoW because this is just asking for botnets to form.