Greasy Fork is available in English.
Improve MooMoo.io FPS performance.
当前为
// ==UserScript==
// @name FPS Booster [Sploop.io, Moomoo.io and other]
// @namespace http://greasyfork.icu/en/users/1064285-vcrazy-gaming
// @version 1.0
// @description Improve MooMoo.io FPS performance.
// @author _VcrazY_
// @match *://*.moomoo.io/*
// @match *://*.sploop.io/*
// @match *://*/*
// @grant none
// @license MIT
// ==/UserScript==
(function () {
'use strict';
let animationFrameId;
const startAnimationFrame = (previousTimestamp = performance.now(), remainingFrameTime = 0) => {
let timeElapsedSinceLastFrame = performance.now() - previousTimestamp,
targetFrameInterval = 16.67 - timeElapsedSinceLastFrame + remainingFrameTime,
frameDelay = targetFrameInterval - (0 | targetFrameInterval);
animationFrameId = requestAnimationFrame(() => startAnimationFrame(previousTimestamp, frameDelay));
};
startAnimationFrame();
window.addEventListener("beforeunload", () => {
animationFrameId && cancelAnimationFrame(animationFrameId);
});
})();