Skip to content

Commit 6755bf1

Browse files
committed
[userscript] amazon-prime-gaming-highlighter: fix collectClaimUrls to properly remove duplicate URLs
1 parent f128902 commit 6755bf1

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

userscripts/amazon-prime-gaming-highlighter/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// @supportURL https://github.com/0xdevalias/userscripts/issues
1010
// @downloadURL https://github.com/0xdevalias/userscripts/raw/main/userscripts/amazon-prime-gaming-highlighter/amazon-prime-gaming-highlighter.user.js
1111
// @namespace https://www.devalias.net/
12-
// @version 1.0.5
12+
// @version 1.0.6
1313
// @match https://gaming.amazon.com/home
1414
// @grant GM_openInTab
1515
// ==/UserScript==

userscripts/amazon-prime-gaming-highlighter/amazon-prime-gaming-highlighter.user.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// @supportURL https://github.com/0xdevalias/userscripts/issues
77
// @downloadURL https://github.com/0xdevalias/userscripts/raw/main/userscripts/amazon-prime-gaming-highlighter/amazon-prime-gaming-highlighter.user.js
88
// @namespace https://www.devalias.net/
9-
// @version 1.0.5
9+
// @version 1.0.6
1010
// @match https://gaming.amazon.com/home
1111
// @grant GM_openInTab
1212
// ==/UserScript==
@@ -215,12 +215,12 @@
215215

216216
function collectClaimURLs() {
217217
const claimButtons = new Set(
218-
Array.from(document.querySelectorAll('.item-card__claim-button a[href]')),
218+
Array.from(document.querySelectorAll('.item-card__claim-button a[href]'))
219+
.map((button) => button.href)
220+
.filter((url) => !url.includes('/web-games/')),
219221
);
220222

221-
return Array.from(claimButtons)
222-
.map((button) => button.href)
223-
.filter((url) => !url.includes('/web-games/'));
223+
return Array.from(claimButtons);
224224
}
225225

226226
function copyURLsToClipboard(urls) {

0 commit comments

Comments
 (0)