vscode format dode

This commit is contained in:
Ralf Vogler 2022-09-26 20:08:52 +02:00
parent 1dc3b3db6a
commit bf647936eb
3 changed files with 13 additions and 13 deletions

View file

@ -98,7 +98,7 @@ try {
} }
// it then creates an iframe for the rest // it then creates an iframe for the rest
// await page.frame({ url: /.*store\/purchase.*/ }).click('button:has-text("Place Order")'); // not found because it does not wait for iframe // await page.frame({ url: /.*store\/purchase.*/ }).click('button:has-text("Place Order")'); // not found because it does not wait for iframe
const iframe = page.frameLocator('#webPurchaseContainer iframe') const iframe = page.frameLocator('#webPurchaseContainer iframe');
await iframe.locator('button:has-text("Place Order")').click(); await iframe.locator('button:has-text("Place Order")').click();
// await page.pause(); // await page.pause();
// I Agree button is only shown for EU accounts! https://github.com/vogler/free-games-claimer/pull/7#issuecomment-1038964872 // I Agree button is only shown for EU accounts! https://github.com/vogler/free-games-claimer/pull/7#issuecomment-1038964872

View file

@ -17,7 +17,7 @@ export const jsonDb = async file => {
const db = new Low(new JSONFile(dataDir(file))); const db = new Low(new JSONFile(dataDir(file)));
await db.read(); await db.read();
return db; return db;
} };
export const datetime = (d = new Date()) => d.toISOString().replace('T', ' ').replace('Z', ''); export const datetime = (d = new Date()) => d.toISOString().replace('T', ' ').replace('Z', '');
export const filenamify = s => s.replaceAll(':', '.').replace(/[^a-z0-9 _\-.]/gi, '_'); // alternative: https://www.npmjs.com/package/filenamify - On Unix-like systems, / is reserved. On Windows, <>:"/\|?* along with trailing periods are reserved. export const filenamify = s => s.replaceAll(':', '.').replace(/[^a-z0-9 _\-.]/gi, '_'); // alternative: https://www.npmjs.com/package/filenamify - On Unix-like systems, / is reserved. On Windows, <>:"/\|?* along with trailing periods are reserved.
@ -61,9 +61,9 @@ export const stealth = async (context) => {
const stealth = { const stealth = {
callbacks: [], callbacks: [],
async evaluateOnNewDocument(...args) { async evaluateOnNewDocument(...args) {
this.callbacks.push({ cb: args[0], a: args[1] }) this.callbacks.push({ cb: args[0], a: args[1] });
}
} }
};
for (const e of enabledEvasions) { for (const e of enabledEvasions) {
const evasion = await import(`puppeteer-extra-plugin-stealth/evasions/${e}/index.js`); const evasion = await import(`puppeteer-extra-plugin-stealth/evasions/${e}/index.js`);
evasion.default().onPageCreated(stealth); evasion.default().onPageCreated(stealth);
@ -71,4 +71,4 @@ export const stealth = async (context) => {
for (let evasion of stealth.callbacks) { for (let evasion of stealth.callbacks) {
await context.addInitScript(evasion.cb, evasion.a); await context.addInitScript(evasion.cb, evasion.a);
} }
} };