Skip to content

Commit 9758436

Browse files
committed
Update for Sword & Shield
1 parent e1e0647 commit 9758436

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

content.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,18 @@ function title_to_url(title) {
4040
const pokemon = title
4141
.replace(/ \((active|fainted)\)/, '') // trim any (active), (fainted)
4242
.replace(/.*\((.*)\)/, "$1"); // whatever is in () is the actual pokemon
43-
return "https://www.smogon.com/dex/sm/pokemon/" + pokemon;
43+
return "https://www.smogon.com/dex/ss/pokemon/" + pokemon;
4444
}
4545

4646
function add_picon_links(room_div) {
4747
const picons = document.querySelectorAll(".teamicons > .picon");
4848
for (const picon of picons) {
49-
if (picon.title === "Not revealed") {
49+
const label = picon.getAttribute('aria-label')
50+
if (label === "Not revealed") {
5051
continue;
5152
}
5253

53-
picon.onclick = () => window.open(title_to_url(picon.title));
54+
picon.onclick = () => window.open(title_to_url(label));
5455
picon.style.cursor = "pointer";
5556
}
5657
}

manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Showdown Helper",
3-
"version": "1.1.0",
3+
"version": "1.2.0",
44
"description": "Adds UI elements to Pokemon Showdown for easier battles",
55
"manifest_version": 2,
66
"permissions": [

0 commit comments

Comments
 (0)