Mining cryptocurrencies is a great way to earn small amounts of residual income (that could possibly be worth much more in the future). This is becoming an alternative revenue source some websites (and people with more nefarious intentions) are banking on.

Salon.com, for example, is giving readers the option to opt out of advertisements in exchange for letting the site use their CPUs to mine Monero, a cryptocurrency that's easier to mine than Bitcoin and has a current market cap of $4.6 billion.

Of course, where there's room for a legitimate way to earn money, corruption is soon to follow.

Anti-malware software firm Malwarebytes and IT security company ESET both warned of sneaky uses of JavaScript files that use the CPU of visitors to mine cryptocurrencies without their knowledge (or explicit permission). This can come in the form of malicious software that is installed on a user's computer, an undetected JavaScript file that mines in the background or a pop-under window that can continue to mine coins even after the browser is closed.

If you're not sure how to determine if your computer is being used to mine coins without your knowledge, make sure to read our article on detecting coin mining. And if it is, how can you put a stop to it? Here are four ways to stop your computer from mining coins without your permission.

Now playing: Watch this: Cryptojacking: The hot new hacker trick for easy money

Should you block coin mining?

Whether you should allow websites to use your computer to mine coins is entirely up to you. In most cases, it's entirely harmless. But the trouble is how ethical it is for a company to use your computer for something other than what you intended.

When a website is upfront about coin mining, there is no harm in supporting its content or service by allowing it to harness your computing power. It's a great trade-off if you're not a fan of advertisements.

That said, mining can affect the performance (and battery life) of your computer and (marginally) increase your power bill. As long as you understand this and give consent, there is no issue. It's when websites decide to do it in the background, without your knowledge, that it becomes unethical.

How to stop sites from mining coins with your CPU

Assuming your computer doesn't have a malicious coin mining program installed, there are a number of ways to block coin mining while you browse.

Disable JavaScript on specific sites

If you suspect a website is using your computer to mine cryptocurrencies without your permission, you can simply block JavaScript altogether.

The problem, however, is that this is a very aggressive way to block mining and will break many websites. Facebook, for instance, will not load without JavaScript enabled.

Coin mining blockers

If you don't want to use an ad blocker or just want to specifically block coin mining, there are a handful of extensions available

No Coin (Chrome, Firefox, Opera)

minerBlock (Chrome, Firefox, Opera)

Anti Miner (Chrome)

Coin-Hive Blocker (Chrome)

These extensions work by blacklisting known domains and mining scripts. They're regularly updated and are among the best hands-off approaches to block mining. On the flip side, if you want to support a website by allowing it to mine, you can whitelist it.

Anti-malware software

While browsers haven't yet adapted to blocking cryptocurrency miners (or at least making them an opt-in option), some anti-malware software has. Malwarebytes, for example, offers cryptocurrency miner blocking in its premium subscription.