您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Click Pokémon icons during battles to open their Smogon StrategyDex page.
// ==UserScript== // @name [PS] Team Dex // @namespace https://greasyfork.org/en/users/1357767-indigeau // @version 0.0 // @description Click Pokémon icons during battles to open their Smogon StrategyDex page. // @match https://play.pokemonshowdown.com/* // @exclude https://play.pokemonshowdown.com/sprites/* // @author indigeau // @license GNU GPLv3 // @icon https://www.google.com/s2/favicons?sz=64&domain=pokemonshowdown.com // @grant none // ==/UserScript== const linkGetter = window.TeambuilderRoom.prototype.smogdexLink; document.body.addEventListener('click', ({target}) => { if (!target.matches('.teamicons > .picon[data-tooltip]')) { return; } const room = window.app.rooms[location.pathname.slice(1)]; if (!room) { return; } const thisArg = { curTeam: { dex: room.battle.dex, format: room.id.split('-')[1], }, }; const [,, index] = target.getAttribute('data-tooltip').split('|'); const isNearSide = target.parentElement.parentElement.classList.contains('trainer-near'); const species = room.battle[`${isNearSide ? 'near' : 'far'}Side`].pokemon[index].speciesForme; window.open(linkGetter.call(thisArg, species)); });