From 094662aefc5bd63e56f53b3565b0429846fed7b6 Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Thu, 6 Oct 2022 23:27:27 +0200 Subject: [PATCH] eg: write data/browser/cookies.json for easy access --- epic-games.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/epic-games.js b/epic-games.js index 18f729c..d7ae275 100644 --- a/epic-games.js +++ b/epic-games.js @@ -1,7 +1,7 @@ import { chromium } from 'playwright'; // stealth plugin needs no outdated playwright-extra import path from 'path'; import { dirs, jsonDb, datetime, stealth, filenamify } from './util.js'; -import { existsSync } from 'fs'; +import { existsSync, writeFileSync } from 'fs'; const debug = process.env.PWDEBUG == '1'; // runs non-headless and opens https://playwright.dev/docs/inspector @@ -155,4 +155,5 @@ try { } finally { await db.write(); // write out json db } +await writeFileSync(path.resolve(dirs.browser, 'cookies.json'), JSON.stringify(await context.cookies())); await context.close();