Skip to content

Commit 0b92a10

Browse files
committed
feat(cookies): expose BROWSER_PROFILE env var for cookie import
Cookie import defaulted to 'Default' profile. Users with multiple browser profiles had no way to target the correct one. Reads BROWSER_PROFILE env var and passes it through to importCookies().
1 parent 700516d commit 0b92a10

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,7 @@ function printUsage(stream = process.stdout) {
291291
' AI_TEMPERATURE - AI temperature 0-2 [default: 0]',
292292
' BROWSER_CHANNEL - Browser to use: brave, chrome, msedge, chromium, arc, comet',
293293
' BROWSER_EXECUTABLE_PATH - Explicit path to browser binary (overrides BROWSER_CHANNEL)',
294+
' BROWSER_PROFILE - Browser profile for cookie import [default: Default]',
294295
' BROWSER_HEADLESS - Run headless (true/false) [default: false]',
295296
' BROWSER_SLOWMO - Slow down actions (ms) [default: 100]',
296297
' OBEY_ROBOTS - Check robots.txt before automation (true/false) [default: false]',
@@ -615,7 +616,8 @@ async function run() {
615616
if (cookiesConfig) {
616617
logger.info(`Importing cookies from ${cookiesConfig.browser}...`);
617618
try {
618-
const result = await importCookies(cookiesConfig.browser, cookiesConfig.domains);
619+
const profile = process.env.BROWSER_PROFILE || 'Default';
620+
const result = await importCookies(cookiesConfig.browser, cookiesConfig.domains, profile);
619621
if (result.count > 0) {
620622
await context.addCookies(result.cookies);
621623
logger.info(`Loaded ${result.count} cookies from ${cookiesConfig.browser}`, {

0 commit comments

Comments
 (0)