workaround for cropped viewport (Playwright regression), fixes #277
This commit is contained in:
parent
7ca79bd413
commit
c3657f05ac
5 changed files with 5 additions and 0 deletions
|
|
@ -41,6 +41,7 @@ await stealth(context);
|
||||||
if (!cfg.debug) context.setDefaultTimeout(cfg.timeout);
|
if (!cfg.debug) context.setDefaultTimeout(cfg.timeout);
|
||||||
|
|
||||||
const page = context.pages().length ? context.pages()[0] : await context.newPage(); // should always exist
|
const page = context.pages().length ? context.pages()[0] : await context.newPage(); // should always exist
|
||||||
|
await page.setViewportSize({ width: cfg.width, height: cfg.height }); // TODO workaround for https://github.com/vogler/free-games-claimer/issues/277 until Playwright fixes it
|
||||||
|
|
||||||
// some debug info about the page (screen dimensions, user agent, platform)
|
// some debug info about the page (screen dimensions, user agent, platform)
|
||||||
// eslint-disable-next-line no-undef
|
// eslint-disable-next-line no-undef
|
||||||
|
|
|
||||||
1
gog.js
1
gog.js
|
|
@ -25,6 +25,7 @@ handleSIGINT(context);
|
||||||
if (!cfg.debug) context.setDefaultTimeout(cfg.timeout);
|
if (!cfg.debug) context.setDefaultTimeout(cfg.timeout);
|
||||||
|
|
||||||
const page = context.pages().length ? context.pages()[0] : await context.newPage(); // should always exist
|
const page = context.pages().length ? context.pages()[0] : await context.newPage(); // should always exist
|
||||||
|
await page.setViewportSize({ width: cfg.width, height: cfg.height }); // TODO workaround for https://github.com/vogler/free-games-claimer/issues/277 until Playwright fixes it
|
||||||
// console.debug('userAgent:', await page.evaluate(() => navigator.userAgent));
|
// console.debug('userAgent:', await page.evaluate(() => navigator.userAgent));
|
||||||
|
|
||||||
const notify_games = [];
|
const notify_games = [];
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,7 @@ await stealth(context);
|
||||||
if (!cfg.debug) context.setDefaultTimeout(cfg.timeout);
|
if (!cfg.debug) context.setDefaultTimeout(cfg.timeout);
|
||||||
|
|
||||||
const page = context.pages().length ? context.pages()[0] : await context.newPage(); // should always exist
|
const page = context.pages().length ? context.pages()[0] : await context.newPage(); // should always exist
|
||||||
|
await page.setViewportSize({ width: cfg.width, height: cfg.height }); // TODO workaround for https://github.com/vogler/free-games-claimer/issues/277 until Playwright fixes it
|
||||||
// console.debug('userAgent:', await page.evaluate(() => navigator.userAgent));
|
// console.debug('userAgent:', await page.evaluate(() => navigator.userAgent));
|
||||||
|
|
||||||
const notify_games = [];
|
const notify_games = [];
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,7 @@ await stealth(context);
|
||||||
if (!cfg.debug) context.setDefaultTimeout(cfg.timeout);
|
if (!cfg.debug) context.setDefaultTimeout(cfg.timeout);
|
||||||
|
|
||||||
const page = context.pages().length ? context.pages()[0] : await context.newPage(); // should always exist
|
const page = context.pages().length ? context.pages()[0] : await context.newPage(); // should always exist
|
||||||
|
await page.setViewportSize({ width: cfg.width, height: cfg.height }); // TODO workaround for https://github.com/vogler/free-games-claimer/issues/277 until Playwright fixes it
|
||||||
// console.debug('userAgent:', await page.evaluate(() => navigator.userAgent));
|
// console.debug('userAgent:', await page.evaluate(() => navigator.userAgent));
|
||||||
|
|
||||||
const notify_games = [];
|
const notify_games = [];
|
||||||
|
|
|
||||||
1
xbox.js
1
xbox.js
|
|
@ -32,6 +32,7 @@ if (!cfg.debug) context.setDefaultTimeout(cfg.timeout);
|
||||||
const page = context.pages().length
|
const page = context.pages().length
|
||||||
? context.pages()[0]
|
? context.pages()[0]
|
||||||
: await context.newPage(); // should always exist
|
: await context.newPage(); // should always exist
|
||||||
|
await page.setViewportSize({ width: cfg.width, height: cfg.height }); // TODO workaround for https://github.com/vogler/free-games-claimer/issues/277 until Playwright fixes it
|
||||||
|
|
||||||
const notify_games = [];
|
const notify_games = [];
|
||||||
let user;
|
let user;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue