Cryptocurrencies are on the rise ever since the whole Bitcoin fiasco. In this guide, we will tell you how you can easily block websites from mining cryptocurrency on your web browser.
According to Google, cryptocurrency is a digital currency in which encryption techniques are used to regulate the generation of units of currency and verify the transfer of funds, operating independently of a central bank.
One of the greatest advantages of cryptocurrency is that it is anonymous and decentralized in nature. Which means that anyone can make completely anonymous transactions with it and no one will be able to track it.
What is Cryptocurrency Mining?
Crypto-mining or cryptocurrency mining is a practice in which the website you visit uses a mining script which uses your browser to mine cryptocurrency by making use of your CPU power. Most of the websites do not indulge in such practices while there are still a lot of websites that do it, even without the user’s knowledge.
For example, The Pirate Bay, the web’s most popular torrent website was caught using a Monero cryptocurrency mining script on their websites. It is a different story that they agreed that they use/will continue to use such practices to help the websites up and running.
This incident raised a serious debate on the online forums on whether or not these practices are right/ethical. On the other hand, this has also enabled the developers to come up with ways by which cryptocurrency mining can easily be blocked as well.
How To Find Out If My Computer Is Secretly Mining Cryptocurrency?
Some websites are being upfront about such practices and let their users know that they are running crypto-mining scripts in the background to make money. While the others do it without the user’s knowledge. Thankfully, it is quite easy to find out whether or not a particular website is running cryptocurrency mining scripts on your website.
Usually, the website which uses crypto-mining scripts in the background will consume more CPU power and hence it will reflect in the task manager/activity monitor of the operating system you are using. For instance, The Pirate Bay users were able to find out about crypto-mining when they spotted the website using more CPU power than the other websites.
If you suspect that a particular website might be using such cryptocurrency mining scripts in the background, simply follow the below steps to find out if your suspicions are true:
Steps to find out cryptocurrency mining:
- Close all the other tabs and keep only that particular website open.
- Windows: Open Task Manager using the Ctrl+Alt+Delete
Mac: Open Activity Monitor – Press Command+Spacebar to get the Spotlight search field and start typing “Activity monitor” Then select the Activity Monitor when it comes up. This will take you to the app. - Alternatively, if you are using Google Chrome browser, you could make use of the inbuilt Chrome Task Manager by going to Menu > More Tools > Task Manager.
Here you can find out if a particular website is using high CPU resource than normal.
Thankfully, there is more than one way to block crypto-mining in web browsers. We shall see them all one by one in detail.
Method 1. Block Coin Mining Domains Using Hosts Files
This is a simple solution by which you can make use of the hosts file on your OS to completely block the websites that you think are using shady practices of coin-mining. We can simply edit the hosts file to redirect the IP to 0.0.0.0 whenever you try to connect to that site, thereby effectively blocking it forever.
Whenever you add a record to the hosts file, always add the record at the last line of the hosts file.
For the sake of this tutorial, we will make use of dummy website called “crypto-mining-example.com”.
Windows: You can find the hosts file in windows in this location:
C:WindowsSystem32driversetc
You can open the hosts file in notepad and simply add the below code at the end:
0.0.0.0 coin-mining-example.com
Linux and Mac:
You can find the hosts file in the location below:
/etc/hosts
Open the terminal window and execute the command below to edit “hosts” file:
sudo nano /etc/hosts
Simply add the code below at the end:
0.0.0.0 coin-mining-example.com
Method 2. Using No Coin Chrome Extension
If you are using Google Chrome, using an extension to monitor and block crypto coin mining is the easiest way. No Coin is an open-source extension which will detect and show if a website is running any sort of crypto mining script in the background, as soon as you visit that website.
You will see a red symbol as shown in the above screenshot. You also get an option to whitelist a particular website for a certain period of time.
- Get No Coin Chrome Extension
Method 3. Using minerBlock Chrome extension
minerBlock is another open-source chrome extension which lets you block cryptocurrency mining in the web browser. It is important to note here that the extension is still in its infancy with only a small number of miner domains in it’s list. It is expected to add more and more domain in the coming days; looks promising.
Just like the No Coin Extension, this one also lets you disable the miner block if you wish to.
Method 4. Use NoScript in FireFox
Crypto mining scripts are not any different than any other normal scripts. They are just a few lines of code which execute the given instruction. If you are using FireFox browser, you can make use of an extension called NoScript to block coin-mining.
When you install NoScript, it gives an option to forbid the scripts from running on a particular website. Please keep in mind that this might break some sites (non-harmful ones) as javascript might be needed for them to run properly. Use this one with caution.
Method 5. Block Coin Mining domains using an Adblocker
Alternatively, we can make use of ad blocking extensions such as AdBlock to stop websites from crypto mining. In this example, we shall use the AdBlock Chrome extension.
Go to the settings page of the AdBlock Chrome extension. Then look for Customize > Block an ad by its URL and add the below URL:
https://coin-hive.com/lib/coinhive.min.js
The deal here is that you need to know the javascript which is responsible for the crypto mining in order to add it to the list. Once you add the specific javascript file, the extension will stop the particular script from running whenever you visit that site.
Method 6. Block Crypto Mining using Opera Web Browser
Starting with Opera Version 50, we have a built-in option in the browser to block coin mining scripts. You simply need to turn on the option in the settings to start blocking crypto mining scripts.
You can find this option in Settings [Preferences on macOS] > Basic > Block ads and under the Recommended lists of ad filters.
Is Crypto Mining Harmful?
That depends. I would not exactly use the words harmful in most cases when it comes to crypto mining. But one thing is for sure: Crypto mining scripts sure use a lot of CPU power than the normal websites and it could be a problem for a lot of people. Especially the ones who are using older computers.
Should I Absolutely Stop All the Crypto Mining Scripts?
It really is a matter of personal preference. Many websites let their users know when they use some sort of crypto mining scripts on their websites. They even provide the option to turn it off. If you are comfortable with the site running scripts in the background (maybe you want to help them out in some way?) and it doesn’t really slow down your computer, then you don’t have to bother about it.
But if such scripts bring down your browsing experience and slow down your computer, no one is going to judge you for killing crypto mining scripts. You have the right to do so and you probably should, in cases like this.
What’s your take?
I hope you found this article about blocking websites from crypto mining on your web browser interesting.
Have you encountered any issues with crypto mining scripts/websites in the past?