Revert "eg: RECORD=1 to recordVideo & recordHar"
This reverts commit 066a99c77c.
This commit is contained in:
parent
066a99c77c
commit
7fc0fbc69c
2 changed files with 1 additions and 9 deletions
|
|
@ -6,7 +6,6 @@ dotenv.config({ path: 'data/config.env' }); // loads env vars from file - will n
|
||||||
// Options - also see table in README.md
|
// Options - also see table in README.md
|
||||||
export const cfg = {
|
export const cfg = {
|
||||||
debug: process.env.PWDEBUG == '1', // runs non-headless and opens https://playwright.dev/docs/inspector
|
debug: process.env.PWDEBUG == '1', // runs non-headless and opens https://playwright.dev/docs/inspector
|
||||||
record: process.env.RECORD == '1', // `recordHar` (network) + `recordVideo`
|
|
||||||
dryrun: process.env.DRYRUN == '1', // don't claim anything
|
dryrun: process.env.DRYRUN == '1', // don't claim anything
|
||||||
show: process.env.SHOW == '1', // run non-headless
|
show: process.env.SHOW == '1', // run non-headless
|
||||||
get headless() { return !this.debug && !this.show },
|
get headless() { return !this.debug && !this.show },
|
||||||
|
|
|
||||||
|
|
@ -27,8 +27,7 @@ const context = await firefox.launchPersistentContext(cfg.dir.browser, {
|
||||||
userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.83 Safari/537.36', // see replace of Headless in util.newStealthContext. TODO Windows UA enough to avoid 'device not supported'? update if browser is updated?
|
userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.83 Safari/537.36', // see replace of Headless in util.newStealthContext. TODO Windows UA enough to avoid 'device not supported'? update if browser is updated?
|
||||||
// userAgent for firefox: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:106.0) Gecko/20100101 Firefox/106.0
|
// userAgent for firefox: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:106.0) Gecko/20100101 Firefox/106.0
|
||||||
locale: "en-US", // ignore OS locale to be sure to have english text for locators
|
locale: "en-US", // ignore OS locale to be sure to have english text for locators
|
||||||
recordVideo: cfg.record && { dir: 'data/record/', size: { width: cfg.width, height: cfg.height } }, // will record a .webm video for each page navigated; without size, video would be scaled down to fit 800x800
|
// recordVideo: { dir: 'data/videos/' }, // will record a .webm video for each page navigated
|
||||||
recordHar: cfg.record && { path: `data/record/eg-${datetime()}.har` }, // will record a HAR file with network requests and responses; can be imported in Chrome devtools
|
|
||||||
args: [ // https://peter.sh/experiments/chromium-command-line-switches
|
args: [ // https://peter.sh/experiments/chromium-command-line-switches
|
||||||
// don't want to see bubble 'Restore pages? Chrome didn't shut down correctly.'
|
// don't want to see bubble 'Restore pages? Chrome didn't shut down correctly.'
|
||||||
// '--restore-last-session', // does not apply for crash/killed
|
// '--restore-last-session', // does not apply for crash/killed
|
||||||
|
|
@ -46,12 +45,6 @@ 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
|
||||||
// console.debug('userAgent:', await page.evaluate(() => navigator.userAgent));
|
// console.debug('userAgent:', await page.evaluate(() => navigator.userAgent));
|
||||||
if (cfg.record && cfg.debug) {
|
|
||||||
// const filter = _ => true;
|
|
||||||
const filter = r => r.url().includes('store.epicgames.com');
|
|
||||||
page.on('request', request => filter(request) && console.log('>>', request.method(), request.url()));
|
|
||||||
page.on('response', response => filter(response) && console.log('<<', response.status(), response.url()));
|
|
||||||
}
|
|
||||||
|
|
||||||
const notify_games = [];
|
const notify_games = [];
|
||||||
let user;
|
let user;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue