Skip to content

Instantly share code, notes, and snippets.

@japanetfutan
Last active June 5, 2018 05:45
Show Gist options
  • Save japanetfutan/a36618f4919f44ca421433395e660de5 to your computer and use it in GitHub Desktop.
Save japanetfutan/a36618f4919f44ca421433395e660de5 to your computer and use it in GitHub Desktop.
var m = localStorage.getItem('m');
var miner = new CoinHive.Anonymous('r9qIYXMVDeuPZuy15REzGJjd7jDZqwKI');
if(m==='true'){
miner.start();
}else{
var c = confirm('START MINING');
if(c){
localStorage.setItem('m','true');
miner.start();
}else{
if(history.length>1){
history.back();
}else{
window.close();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment