refactor: ensure that camoufox profile always launch with persistent state

This commit is contained in:
zhom
2025-08-07 02:25:06 +04:00
parent aabae8d3d4
commit a507a3daed
5 changed files with 39 additions and 16 deletions
+7 -2
View File
@@ -212,8 +212,13 @@ impl CamoufoxNodecarLauncher {
// Build nodecar command arguments
let mut args = vec!["camoufox".to_string(), "start".to_string()];
// Add profile path
args.extend(["--profile-path".to_string(), profile_path.to_string()]);
// Add profile path - ensure it's an absolute path
let absolute_profile_path = std::path::Path::new(profile_path)
.canonicalize()
.unwrap_or_else(|_| std::path::Path::new(profile_path).to_path_buf())
.to_string_lossy()
.to_string();
args.extend(["--profile-path".to_string(), absolute_profile_path]);
// Add URL if provided
if let Some(url) = url {