DEBUG_NETWORK=1 to log network requests and responses instead of DEBUG && RECORD
This commit is contained in:
parent
19e9bb9cfc
commit
30957d63d0
2 changed files with 2 additions and 1 deletions
|
|
@ -6,6 +6,7 @@ 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.DEBUG == '1' || process.env.PWDEBUG == '1', // runs non-headless and opens https://playwright.dev/docs/inspector
|
debug: process.env.DEBUG == '1' || process.env.PWDEBUG == '1', // runs non-headless and opens https://playwright.dev/docs/inspector
|
||||||
|
debug_network: process.env.DEBUG_NETWORK == '1', // log network requests and responses
|
||||||
record: process.env.RECORD == '1', // `recordHar` (network) + `recordVideo`
|
record: process.env.RECORD == '1', // `recordHar` (network) + `recordVideo`
|
||||||
time: process.env.TIME == '1', // log duration of each step
|
time: process.env.TIME == '1', // log duration of each step
|
||||||
dryrun: process.env.DRYRUN == '1', // don't claim anything
|
dryrun: process.env.DRYRUN == '1', // don't claim anything
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ const page = context.pages().length ? context.pages()[0] : await context.newPage
|
||||||
// console.debug('userAgent:', await page.evaluate(() => navigator.userAgent));
|
// console.debug('userAgent:', await page.evaluate(() => navigator.userAgent));
|
||||||
// eslint-disable-next-line no-undef
|
// eslint-disable-next-line no-undef
|
||||||
if (cfg.debug) console.debug(await page.evaluate(() => window.screen));
|
if (cfg.debug) console.debug(await page.evaluate(() => window.screen));
|
||||||
if (cfg.record && cfg.debug) {
|
if (cfg.debug_network) {
|
||||||
// const filter = _ => true;
|
// const filter = _ => true;
|
||||||
const filter = r => r.url().includes('store.epicgames.com');
|
const filter = r => r.url().includes('store.epicgames.com');
|
||||||
page.on('request', request => filter(request) && console.log('>>', request.method(), request.url()));
|
page.on('request', request => filter(request) && console.log('>>', request.method(), request.url()));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue