Texture Replacer

ok

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

Advertisement:

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

Advertisement:

// ==UserScript==
// @name        Texture Replacer
// @version     0.6.7
// @description ok
// @author      nyannez
// @match       *://*.sploop.io/
// @run-at      document-start
// @namespace https://greasyfork.org/users/960747
// ==/UserScript==

//here example

const patterns = {
    ["/items/platform.png"]:  "https://media.discordapp.net/attachments/1046598378647208097/1131063732043264103/0dd9ff4b3ac3a40f.png?ex=65dea72f&is=65cc322f&hm=53b091d4826e17204049df57283e0471a7aacbc3fc13cfe9c3c5c01410140de2&=&format=webp&quality=lossless",
    ["/entity/platform.png"]:  "https://media.discordapp.net/attachments/1046598378647208097/1131063732043264103/0dd9ff4b3ac3a40f.png?ex=65dea72f&is=65cc322f&hm=53b091d4826e17204049df57283e0471a7aacbc3fc13cfe9c3c5c01410140de2&=&format=webp&quality=lossless"
};

const src = Object.getOwnPropertyDescriptor(Image.prototype, "src").set;
Object.defineProperty(Image.prototype, "src", {
    set(link) {
        const replace = Object.entries(patterns).find(a => link.match(a[0]));
        if (replace) {
            link = replace[1];
        }
        return src.call(this, link);
    }
})