您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Added a button in pokemon showdown replay page to copy all the replay links to paste in the replay scouter
// ==UserScript== // @name Pokémon Showdown Replay Link Exporter // @namespace http://tampermonkey.net/ // @version 1.2 // @description Added a button in pokemon showdown replay page to copy all the replay links to paste in the 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 = 'Copy all replay links'; 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 = `Copied ${links.length} links!`; setTimeout(() => { exportButton.innerHTML = 'Copy all replay links'; }, 2000); } else { exportButton.innerHTML = 'Did not find any links'; setTimeout(() => { exportButton.innerHTML = 'Copy all replay links'; }, 2000); } }); } }, 500); })();