您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
在pokemon showdown replay添加一个按钮用于一键复制所有回放链接以便复制到replay scouter中
// ==UserScript== // @name Pokemon Showdown一键复制rep链接 // @namespace http://tampermonkey.net/ // @version 1.2 // @description 在pokemon showdown replay添加一个按钮用于一键复制所有回放链接以便复制到replay scouter中 // @author You // @match https://replay.pokemonshowdown.com/* // @grant GM_setClipboard // @grant GM_addStyle // @license WTFPL // ==/UserScript== (function() { 'use strict'; GM_addStyle(` .export-replay-button { background-color: #4CAF50; color: white; padding: 8px 15px; border: none; border-radius: 5px; cursor: pointer; font-size: 14px; margin-left: 15px; vertical-align: middle; } .export-replay-button:hover { background-color: #45a049; } `); const checkInterval = setInterval(() => { const targetElement = document.querySelector('.main h1'); if (targetElement && !document.querySelector('.export-replay-button')) { clearInterval(checkInterval); let exportButton = document.createElement('button'); exportButton.innerHTML = '复制所有回放链接'; exportButton.className = 'export-replay-button'; targetElement.appendChild(exportButton); exportButton.addEventListener('click', () => { const linkElements = document.querySelectorAll('ul.linklist a.blocklink'); if (linkElements.length > 0) { const links = Array.from(linkElements).map(a => a.href); const linksText = links.join('\n'); GM_setClipboard(linksText, 'text'); exportButton.innerHTML = `已复制 ${links.length} 条链接!`; setTimeout(() => { exportButton.innerHTML = '复制所有回放链接'; }, 2000); } else { exportButton.innerHTML = '未找到链接'; setTimeout(() => { exportButton.innerHTML = '复制所有回放链接'; }, 2000); } }); } }, 500); })();