Agar.io Trident Extension

Change white background color to gray, show current time

目前为 2018-02-25 提交的版本。查看 最新版本

// ==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);
};

})();

QingJ © 2025

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