FuckEducoder

This scipt is used for unfreezing educoder's copy restriction. Enjoy it!

目前為 2023-11-10 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name FuckEducoder
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.0
  5. // @description This scipt is used for unfreezing educoder's copy restriction. Enjoy it!
  6. // @author SunSeaLucky
  7. // @match https://www.educoder.net/tasks/*
  8. // @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
  9. // @grant none
  10. // @run-at document-start
  11. // @license MIT
  12. // @require https://cdnjs.cloudflare.com/ajax/libs/crypto-js/4.1.1/crypto-js.min.js
  13. // ==/UserScript==
  14.  
  15. const max = 30000;
  16. const min = 5000;
  17.  
  18. (function () {
  19. 'use strict';
  20. let oldFetch = fetch;
  21. function hookFetch(...args) {
  22. return new Promise((resolve, reject) => {
  23. oldFetch.apply(this, arguments).then((response) => {
  24. if (arguments[0].indexOf('homework_common_id') !== -1) {
  25. const oldJson = response.json;
  26. response.json = function () {
  27. return new Promise((resolve, reject) => {
  28. oldJson.apply(this, arguments).then((result) => {
  29. result.game.cost_time = Math.floor(Math.random() * (max - min + 1)) + min;
  30. result.shixun.forbid_copy = false;
  31. result.shixun.vip = true;
  32. resolve(result);
  33. });
  34. });
  35. };
  36. }
  37. resolve(response);
  38. });
  39. });
  40. }
  41.  
  42. window.fetch = hookFetch;
  43. })();