refactor: popular camoufox data via env variable

This commit is contained in:
zhom
2025-07-08 19:11:30 +04:00
parent a1403c88f9
commit add4f6d3f8
4 changed files with 357 additions and 75 deletions
+5 -3
View File
@@ -457,9 +457,7 @@ impl CamoufoxLauncher {
.and_then(|v| v.as_str())
.or_else(|| process.get("profilePath").and_then(|v| v.as_str()));
if let (Some(id), Some(executable_path), Some(profile_path)) =
(id, executable_path, profile_path)
{
if let Some(id) = id {
let pid = process
.get("pid")
.and_then(|v| v.as_u64())
@@ -470,6 +468,10 @@ impl CamoufoxLauncher {
.and_then(|v| v.as_str())
.map(|s| s.to_string());
// Use empty strings if executable_path or profile_path are missing
let executable_path = executable_path.unwrap_or("");
let profile_path = profile_path.unwrap_or("");
results.push(CamoufoxLaunchResult {
id: id.to_string(),
pid,