-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGameGridRemoval.user.js
66 lines (57 loc) · 1.86 KB
/
GameGridRemoval.user.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
// ==UserScript==
// @name Moomoo.io Game grid removal
// @author Murka
// @description Removes the game grid
// @icon https://moomoo.io/img/favicon.png?v=1
// @version 0.3
// @match *://moomoo.io/*
// @match *://*.moomoo.io/*
// @run-at document-start
// @grant none
// @license MIT
// @namespace https://greasyfork.org/users/919633
// ==/UserScript==
/* jshint esversion:6 */
/*
Author: Murka
Github: https://github.com/Murka007
Discord: https://discord.gg/sG9cyfGPj5
Greasyfork: https://greasyfork.org/en/users/919633
MooMooForge: https://github.com/MooMooForge
*/
(function() {
"use strict";
// Change to true or false
const GRID_ENABLED = false;
function inRange(value, min, max) {
return value > min && value < max;
}
function createHook(target, prop, callback) {
const symbol = Symbol(prop);
Object.defineProperty(target, prop, {
get() { return this[symbol]; },
set(value) { callback(this, symbol, value); },
configurable: true
})
}
createHook(window, "config", function(that, symbol, value) {
if (typeof value === "object" && value.hasOwnProperty("maxScreenHeight")) {
delete window.config;
Object.defineProperty(window, "config", {
value: value,
configurable: false,
writeable: false
})
}
})
CanvasRenderingContext2D.prototype.moveTo = new Proxy(CanvasRenderingContext2D.prototype.moveTo, {
apply(target, _this, args) {
if (!GRID_ENABLED) {
const [ x, y ] = args;
const { maxScreenWidth, maxScreenHeight } = window.config || {};;
if (inRange(x, 0, maxScreenWidth) || inRange(y, 0, maxScreenHeight)) return null;
}
return target.apply(_this, args);
}
})
})();