Diep.io Borderless

Diep.io theme without borders!

이 스크립트를 설치하려면 Tampermonkey, Greasemonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

You will need to install an extension such as Tampermonkey to install this script.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Userscripts와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 유저 스크립트 관리자 확장 프로그램이 필요합니다.

(이미 유저 스크립트 관리자가 설치되어 있습니다. 설치를 진행합니다!)

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

(이미 유저 스타일 관리자가 설치되어 있습니다. 설치를 진행합니다!)

// ==UserScript==
// @name         Diep.io Borderless
// @namespace    https://diep.io
// @version      1.0
// @description  Diep.io theme without borders!
// @author       Binary
// @match        https://diep.io/*
// @run-at       document-end
// ==/UserScript==

// [level up bar, score bar, health bar, *score bar for the 4 team colors*]
const whitelistedStrokes = ['rgb(255,222,67)', 'rgb(67,255,145)', 'rgb(133,227,125)', 'rgb(0,178,225)', 'rgb(241,78,84)', 'rgb(0,225,110)', 'rgb(191,127,245)'];
// [blue stroke, red stroke, green stroke, purple stroke], primarily used to take care of circle tank borders. this patch disappears if the tank is hit though (since they temporarily turn red)
const blacklistedFills = ['rgb(0,133,168)', 'rgb(180,58,63)', 'rgb(0,168,82)', 'rgb(143,95,183)'];

const strokeDesc = Object.getOwnPropertyDescriptor(CanvasRenderingContext2D.prototype, 'strokeStyle');
const fillDesc = Object.getOwnPropertyDescriptor(CanvasRenderingContext2D.prototype, 'fillStyle');

strokeDesc.set = new Proxy(strokeDesc.set, {
    apply(t, thisArg, args) {
        if (!whitelistedStrokes.includes(args[0])) args[0] = 'rgba(0,0,0,0)';
        return Reflect.apply(t, thisArg, args);
    }
});
fillDesc.set = new Proxy(fillDesc.set, {
    apply(t, thisArg, args) {
        if (blacklistedFills.includes(args[0])) args[0] = 'rgba(0,0,0,0)';
        return Reflect.apply(t, thisArg, args);
    }
});
Object.defineProperty(CanvasRenderingContext2D.prototype, 'strokeStyle', strokeDesc);
Object.defineProperty(CanvasRenderingContext2D.prototype, 'fillStyle', fillDesc);