您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
image bot
当前为
// ==UserScript== // @name Drawaria.Online Image-Upload // @namespace http://tampermonkey.net/ // @version 1.0 // @description image bot // @author Mr Robot // @author Discord: Sinasinb#3578 // @match https://drawaria.online/ // @match https://drawaria.online/room* // @grant none // ==/UserScript== (function() { 'use strict'; // Create a dropdown var dropdown = document.createElement("select"); dropdown.id = "image-dropdown"; document.body.appendChild(dropdown); // Add options to the dropdown var options = ["Select an image", "Image 1", "Image 2", "Image 3"]; for (var i = 0; i < options.length; i++) { var option = document.createElement("option"); option.value = options[i]; option.text = options[i]; dropdown.appendChild(option); } // Create a file upload button var input = document.createElement("input"); input.type = "file"; input.id = "image-upload"; document.body.appendChild(input); // Add an event listener to the file upload button input.addEventListener("change", function(event) { // Get the canvas element var canvas = document.getElementById("canvas"); // Get the context of the canvas element var ctx = canvas.getContext("2d"); // Get the uploaded file var file = event.target.files[0]; // Create a new image element var image = new Image(); // Set the source of the image element to the uploaded file image.src = URL.createObjectURL(file); // Add an event listener to the image element image.addEventListener("load", function() { // Draw the image onto the canvas ctx.drawImage(image, 0, 0, canvas.width, canvas.height); }); }); })();