Skip to content

Commit 09b8671

Browse files
committed
viewport dimensions via env
1 parent 1c38f73 commit 09b8671

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

prime-gaming.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ const headless = !debug && !show;
99
// const URL_LOGIN = 'https://www.amazon.de/ap/signin'; // wrong. needs some session args to be valid?
1010
const URL_CLAIM = 'https://gaming.amazon.com/home';
1111
const TIMEOUT = 20 * 1000; // 20s, default is 30s
12+
const SCREEN_WIDTH = Number(process.env.SCREEN_WIDTH) || 1280;
13+
const SCREEN_HEIGHT = Number(process.env.SCREEN_HEIGHT) || 1280;
1214

1315
console.log(datetime(), 'started checking prime-gaming');
1416

@@ -27,7 +29,7 @@ const run = {
2729
const context = await firefox.launchPersistentContext(dirs.browser, {
2830
// channel: 'chrome', // https://playwright.dev/docs/browsers#google-chrome--microsoft-edge, chrome will not work on arm64 linux, only chromium which is the default
2931
headless,
30-
viewport: { width: 1280, height: 1280 },
32+
viewport: { width: SCREEN_WIDTH, height: SCREEN_HEIGHT },
3133
locale: "en-US", // ignore OS locale to be sure to have english text for locators
3234
});
3335

0 commit comments

Comments
 (0)