Fake random.org

Fake ranndom.org result

  1. // ==UserScript==
  2. // @name Fake random.org
  3. // @version 0.2
  4. // @description Fake ranndom.org result
  5. // @namespace greasyfork.org/en/scripts/476305-fake-random-org
  6. // @namespace gist.github.com/nghiepdev/5cab09f3edb35c4a17af2453fb01a852
  7. // @author nghiepdev
  8. // @match https://www.random.org/widgets/integers/iframe?*
  9. // @match https://random.org/widgets/integers/iframe?*
  10. // @icon https://www.google.com/s2/favicons?sz=64&domain=random.org
  11. // @grant none
  12. // @license GPLv3
  13. // ==/UserScript==
  14.  
  15. (function() {
  16. 'use strict';
  17. const RESULT = [13, 14, 15, 16, 17];
  18. let INDEX = 0;
  19. const originalReplaceAll = window.replaceAll;
  20. window.replaceAll = (a, b, c) => {
  21. const result = originalReplaceAll(a, b, c);
  22. if(INDEX > RESULT.length - 1) {
  23. INDEX = 0;
  24. }
  25. return result.replace(/\d+(?=\<br)/, RESULT.at(INDEX++));
  26. };
  27. })();