您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Adds a copy to clipboard button in the upper right corner of the page
当前为
// ==UserScript== // @name Copy Mturk ID to Clipboard Button // @namespace http://tampermonkey.net/ // @version 0.1 // @description Adds a copy to clipboard button in the upper right corner of the page // @match *://*/* // @grant none // @license MIT // ==/UserScript== (function() { 'use strict'; // Create the button element let copyButton = document.createElement('button'); copyButton.innerHTML = 'Mturk'; copyButton.style.position = 'fixed'; copyButton.style.top = '45px'; copyButton.style.right = '10px'; copyButton.style.zIndex = '9999'; copyButton.style.borderRadius = '50%'; copyButton.style.backgroundColor = 'red'; copyButton.style.width = '30px'; copyButton.style.height = '30px'; // Add hover effect copyButton.onmouseover = function() { this.style.width = 'auto'; this.style.height = 'auto'; this.style.borderRadius = '5px'; this.style.padding = '5px 10px'; } copyButton.onmouseout = function() { this.style.width = '30px'; this.style.height = '30px'; this.style.borderRadius = '50%'; this.style.padding = '0px'; } // Add click event to copy text to clipboard copyButton.onclick = function() { navigator.clipboard.writeText('A4T4577P6JL6R'); } // Append the button to the body document.body.appendChild(copyButton); })();