您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Upload image for custom skin
当前为
// ==UserScript== // @name Agar.io custom skin upload to skin // @namespace http://tampermonkey.net/ // @version 0.1 // @description Upload image for custom skin // @author New Jack 🕹️ // @match agar.io/* // @grant none // @license MIT // ==/UserScript== (function () { 'use strict'; function createButton() { const button = document.createElement("input"); button.type = "file"; button.accept = "image/*"; button.id = "customImageUpload"; return button; } function insertButton(button, target) { if (target) { target.appendChild(button); } } function convertImageToBase64(event) { const file = event.target.files[0]; const reader = new FileReader(); reader.onloadend = function () { const base64 = reader.result; drawImage(base64); }; reader.readAsDataURL(file); } function drawImage(base64) { const c = document.getElementById("skin-editor-canvas"); const ctx = c.getContext("2d"); const image = new Image(); image.onload = function () { ctx.drawImage(image, 0, 0); ctx.save(); }; image.src = base64; } function checkForRightTools() { const rightTools = document.querySelector(".right-tools"); if (rightTools) { const button = createButton(); insertButton(button, rightTools); button.addEventListener("change", convertImageToBase64); // Clear the interval once the button is added. clearInterval(checkInterval); } } // Check for the .right-tools element every 5 seconds (5000 milliseconds). const checkInterval = setInterval(checkForRightTools, 5000); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址