Skip to content

Commit 7196a26

Browse files
authored
Merge pull request #48 from vogler/eg-unavailable-region
eg: skip if "This product is currently unavailable in your region"
2 parents 8139c0a + c09da8e commit 7196a26

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

epic-games.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,11 @@ try {
145145
// it then creates an iframe for the purchase
146146
await page.waitForSelector('#webPurchaseContainer iframe'); // TODO needed?
147147
const iframe = page.frameLocator('#webPurchaseContainer iframe');
148+
// skip game if unavailable in region, https://github.com/vogler/free-games-claimer/issues/46 TODO check games for account's region
149+
if (await iframe.locator(':has-text("unavailable in your region")').count() > 0) {
150+
console.error(' This product is unavailable in your region!');
151+
continue;
152+
}
148153
await iframe.locator('button:has-text("Place Order")').click();
149154

150155
// I Agree button is only shown for EU accounts! https://github.com/vogler/free-games-claimer/pull/7#issuecomment-1038964872

0 commit comments

Comments
 (0)