vscode format dode
This commit is contained in:
parent
1dc3b3db6a
commit
bf647936eb
3 changed files with 13 additions and 13 deletions
|
|
@ -98,7 +98,7 @@ try {
|
|||
}
|
||||
// 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
|
||||
const iframe = page.frameLocator('#webPurchaseContainer iframe')
|
||||
const iframe = page.frameLocator('#webPurchaseContainer iframe');
|
||||
await iframe.locator('button:has-text("Place Order")').click();
|
||||
// await page.pause();
|
||||
// I Agree button is only shown for EU accounts! https://github.com/vogler/free-games-claimer/pull/7#issuecomment-1038964872
|
||||
|
|
|
|||
8
util.js
8
util.js
|
|
@ -17,7 +17,7 @@ export const jsonDb = async file => {
|
|||
const db = new Low(new JSONFile(dataDir(file)));
|
||||
await db.read();
|
||||
return db;
|
||||
}
|
||||
};
|
||||
|
||||
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.
|
||||
|
|
@ -61,9 +61,9 @@ export const stealth = async (context) => {
|
|||
const stealth = {
|
||||
callbacks: [],
|
||||
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) {
|
||||
const evasion = await import(`puppeteer-extra-plugin-stealth/evasions/${e}/index.js`);
|
||||
evasion.default().onPageCreated(stealth);
|
||||
|
|
@ -71,4 +71,4 @@ export const stealth = async (context) => {
|
|||
for (let evasion of stealth.callbacks) {
|
||||
await context.addInitScript(evasion.cb, evasion.a);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue