From 076738e3012ff9f90b75e9c6161f63314c96d6a1 Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Tue, 25 Jun 2024 13:09:10 +0200 Subject: [PATCH] gog: fail if WIDTH<1280 due to hidden username, closes #335 --- gog.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gog.js b/gog.js index de5d02f..40d8fad 100644 --- a/gog.js +++ b/gog.js @@ -10,6 +10,11 @@ console.log(datetime(), 'started checking gog'); const db = await jsonDb('gog.json', {}); +if (cfg.width < 1280) { // otherwise 'Sign in' and #menuUsername are hidden (but attached to DOM), see https://github.com/vogler/free-games-claimer/issues/335 + console.error(`Window width is set to ${cfg.width} but needs to be at least 1280 for GOG!`); + process.exit(1); +} + // https://playwright.dev/docs/auth#multi-factor-authentication const context = await firefox.launchPersistentContext(cfg.dir.browser, { headless: cfg.headless,