cbrowser 17.6.0 → 18.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -598,7 +598,7 @@ OPTIONS
598
598
  --record-video Enable video recording
599
599
  --force Bypass red zone safety checks
600
600
  --headless Run browser in headless mode
601
- --persistent Enable persistent browser context (cookies survive)
601
+ --no-persistent Disable persistent browser context (default: enabled)
602
602
 
603
603
  ENVIRONMENT VARIABLES
604
604
  CBROWSER_DATA_DIR Custom data directory (default: ~/.cbrowser)
@@ -1280,9 +1280,11 @@ Documentation: https://github.com/alexandriashai/cbrowser/wiki
1280
1280
  process.exit(1);
1281
1281
  }
1282
1282
  }
1283
- const persistentMode = options.persistent === true || options.persistent === "true";
1284
- if (persistentMode) {
1285
- console.log("🔄 Persistent mode enabled");
1283
+ // Default to persistent mode for session continuity between commands
1284
+ // Use --no-persistent to disable
1285
+ const persistentMode = options.persistent !== false && options.persistent !== "false";
1286
+ if (!persistentMode) {
1287
+ console.log("🔄 Persistent mode disabled");
1286
1288
  }
1287
1289
  // Default to headless for CLI usage, unless explicitly set to false
1288
1290
  const headless = options.headless !== false && options.headless !== "false";
@@ -2335,8 +2337,11 @@ Documentation: https://github.com/alexandriashai/cbrowser/wiki
2335
2337
  console.error("Run 'cbrowser device list' to see available devices");
2336
2338
  process.exit(1);
2337
2339
  }
2340
+ // Save device setting to persistent session state
2341
+ const deviceBrowser = new CBrowser({ persistent: true, headless: true, verbose: false });
2342
+ deviceBrowser.saveDeviceSetting(deviceName);
2338
2343
  console.log(`✓ Device set: ${deviceName}`);
2339
- console.log(" Note: Device emulation applies to new browser sessions");
2344
+ console.log(" Device emulation will apply to all subsequent commands");
2340
2345
  break;
2341
2346
  }
2342
2347
  default: