MooMoo.io Change Resolution

Change the resolution of canvas to boost your FPS

  1. // ==UserScript==
  2. // @name MooMoo.io Change Resolution
  3. // @description Change the resolution of canvas to boost your FPS
  4. // @author WEIRD
  5. // @match *://*.moomoo.io/*
  6. // @icon https://moomoo.io/img/favicon.png?v=1
  7. // @run-at document-start
  8. // @grant unsafeWindow
  9. // @license MIT
  10. // @version 0.1.1
  11. // @namespace https://gf.qytechs.cn/users/999838
  12. // ==/UserScript==
  13.  
  14. ;(() => {
  15. unsafeWindow.changeResolution = true
  16.  
  17. const checkTrustedSymbol = Symbol("checkTrusted")
  18. Object.defineProperty(Object.prototype, "checkTrusted", {
  19. get() {
  20. return this[checkTrustedSymbol]
  21. },
  22. set() {
  23. delete Object.prototype.checkTrusted
  24. this.checkTrusted = (e) => e
  25. },
  26. configurable: true
  27. })
  28.  
  29. var resolutionValue = localStorage.getItem("resolutionValue")
  30. if (resolutionValue == null) {
  31. resolutionValue = 0.9
  32. localStorage.setItem("resolutionValue", resolutionValue)
  33. }
  34.  
  35. unsafeWindow.addEventListener("DOMContentLoaded", () => {
  36. const parent =
  37. document.getElementsByClassName("settingRadio")[0]
  38. parent.childNodes[1].textContent = " Change Resolution"
  39. unsafeWindow.devicePixelRatio = resolutionValue
  40. document.getElementById("nativeResolution").dispatchEvent(
  41. new Event("change")
  42. )
  43.  
  44. const container = document.createElement("div")
  45. container.className = "settingRadio"
  46. const numInput = document.createElement("input")
  47. numInput.type = "number"
  48. numInput.step = "0.1"
  49. numInput.min = "0.1"
  50. numInput.max = "3"
  51. numInput.value = resolutionValue
  52. numInput.addEventListener("change", (event) => {
  53. if (event.target.value < event.target.min) {
  54. event.target.value = event.target.min
  55. } else if (event.target.value > event.target.max) {
  56. event.target.value = event.target.max
  57. } else if (event.target.value == null) {
  58. event.target.value = 0.9
  59. }
  60. resolutionValue = unsafeWindow.devicePixelRatio = event.target.value
  61. localStorage.setItem("resolutionValue", resolutionValue)
  62. document.getElementById(
  63. "nativeResolution"
  64. ).dispatchEvent(new Event("change"))
  65. })
  66. container.appendChild(numInput)
  67. parent.parentNode.insertBefore(container, parent.nextSibling)
  68. })
  69. })()

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址