Change white background color to gray, show current time
当前为
// ==UserScript==
// @name Agar.io Trident Extension
// @namespace http://tampermonkey.net/
// @version 1.0
// @description Change white background color to gray, show current time
// @author ?
// @match http://agar.io/*
// @grant none
// @run-at document-end
// ==/UserScript==
(function() {
'use strict';
var New_WhiteBackgroundColor = '#bbbbbb';
var old_fillRect = CanvasRenderingContext2D.prototype.fillRect;
CanvasRenderingContext2D.prototype.fillRect = function() {
var x = arguments[0];
var y = arguments[1];
var w = arguments[2];
var h = arguments[3];
if (x==0 && y==0 && w==this.canvas.width && h==this.canvas.height) {
if (this.fillStyle == '#f2fbff') // agar.io white background color
this.fillStyle = New_WhiteBackgroundColor;
}
return old_fillRect.apply(this, arguments);
};
var old_fillText = CanvasRenderingContext2D.prototype.fillText;
CanvasRenderingContext2D.prototype.fillText = function() {
if (arguments[0]=='Leaderboard')
arguments[0] = 'Leaders ' + new Date().toLocaleTimeString('en', {hour12: false, hour: "numeric", minute: "numeric"});
return old_fillText.apply(this, arguments);
};
})();