mirror of
https://github.com/zhom/donutbrowser.git
synced 2026-07-06 04:57:48 +02:00
refactor: popular camoufox data via env variable
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user