Further clean Sonar: merge base RUN, strip comments, node imports
This commit is contained in:
parent
405e801851
commit
397871b012
4 changed files with 2 additions and 17 deletions
5
gog.js
5
gog.js
|
|
@ -32,7 +32,6 @@ if (!cfg.debug) context.setDefaultTimeout(cfg.timeout);
|
|||
|
||||
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));
|
||||
|
||||
const notify_games = [];
|
||||
let user;
|
||||
|
|
@ -42,7 +41,6 @@ try {
|
|||
|
||||
await page.goto(URL_CLAIM, { waitUntil: 'domcontentloaded' }); // default 'load' takes forever
|
||||
|
||||
// page.click('#CybotCookiebotDialogBodyLevelButtonLevelOptinAllowAll').catch(_ => { }); // does not work reliably, solved by setting CookieConsent above
|
||||
const signIn = page.locator('a:has-text("Sign in")').first();
|
||||
await Promise.any([signIn.waitFor(), page.waitForSelector('#menuUsername')]);
|
||||
while (await signIn.isVisible()) {
|
||||
|
|
@ -71,12 +69,9 @@ try {
|
|||
await iframe.locator('#second_step_authentication_send').click();
|
||||
await page.waitForTimeout(1000); // TODO still needed with wait for username below?
|
||||
}).catch(_ => { });
|
||||
// iframe.locator('iframe[title=reCAPTCHA]').waitFor().then(() => {
|
||||
// iframe.locator('.g-recaptcha').waitFor().then(() => {
|
||||
iframe.locator('text=Invalid captcha').waitFor().then(() => {
|
||||
console.error('Got a captcha during login (likely due to too many attempts)! You may solve it in the browser, get a new IP or try again in a few hours.');
|
||||
notify('gog: got captcha during login. Please check.');
|
||||
// TODO solve reCAPTCHA?
|
||||
}).catch(_ => { });
|
||||
await page.waitForSelector('#menuUsername');
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue