Skip to content

Commit

Permalink
Update prime-gaming.js
Browse files Browse the repository at this point in the history
account for more than one account link button
  • Loading branch information
Primajin authored Dec 23, 2023
1 parent e06ad3a commit 093ed81
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions prime-gaming.js
Original file line number Diff line number Diff line change
Expand Up @@ -349,12 +349,12 @@ try {
await page.goto(url, { waitUntil: 'domcontentloaded' });
// most games have a button 'Get in-game content'
// epic-games: Fall Guys: Claim -> Continue -> Go to Epic Games (despite account linked and logged into epic-games) -> not tied to account but via some cookie?
await Promise.any([page.click('button:has-text("Get in-game content")'), page.click('button:has-text("Claim your gift")'), page.click('button:has-text("Claim")').then(() => page.click('button:has-text("Continue")'))]);
await Promise.any([page.click('.tw-button:has-text("Get in-game content")'), page.click('.tw-button:has-text("Claim your gift")'), page.click('.tw-button:has-text("Claim")').then(() => page.click('button:has-text("Continue")'))]);
page.click('button:has-text("Continue")').catch(_ => { });
const linkAccountButton = page.locator('[data-a-target="LinkAccountButton"]');
let unlinked_store;
if (await linkAccountButton.count()) {
unlinked_store = await linkAccountButton.getAttribute('aria-label');
unlinked_store = await linkAccountButton.first().getAttribute('aria-label');
console.debug(' LinkAccountButton label:', unlinked_store);
const match = unlinked_store.match(/Link (.*) account/);
if (match && match.length == 2) unlinked_store = match[1];
Expand Down

0 comments on commit 093ed81

Please sign in to comment.