mirror of
https://github.com/zhom/donutbrowser.git
synced 2026-07-20 19:31:16 +02:00
feat: allow user select system for which to generate fingerprint
This commit is contained in:
@@ -214,6 +214,10 @@ impl BrowserRunner {
|
||||
updated_camoufox_config.fingerprint = Some(new_fingerprint);
|
||||
// Preserve the randomize flag so it persists across launches
|
||||
updated_camoufox_config.randomize_fingerprint_on_launch = Some(true);
|
||||
// Preserve the OS setting so it's used for future fingerprint generation
|
||||
if camoufox_config.os.is_some() {
|
||||
updated_camoufox_config.os = camoufox_config.os.clone();
|
||||
}
|
||||
updated_profile.camoufox_config = Some(updated_camoufox_config.clone());
|
||||
|
||||
log::info!(
|
||||
|
||||
@@ -23,6 +23,7 @@ pub struct CamoufoxConfig {
|
||||
pub executable_path: Option<String>,
|
||||
pub fingerprint: Option<String>, // JSON string of the complete fingerprint config
|
||||
pub randomize_fingerprint_on_launch: Option<bool>, // Generate new fingerprint on every launch
|
||||
pub os: Option<String>, // Operating system for fingerprint generation: "windows", "macos", or "linux"
|
||||
}
|
||||
|
||||
impl Default for CamoufoxConfig {
|
||||
@@ -40,6 +41,7 @@ impl Default for CamoufoxConfig {
|
||||
executable_path: None,
|
||||
fingerprint: None,
|
||||
randomize_fingerprint_on_launch: None,
|
||||
os: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -171,6 +173,11 @@ impl CamoufoxManager {
|
||||
}
|
||||
}
|
||||
|
||||
// Add OS option for fingerprint generation
|
||||
if let Some(os) = &config.os {
|
||||
config_args.extend(["--os".to_string(), os.clone()]);
|
||||
}
|
||||
|
||||
// Execute config generation command
|
||||
let mut config_sidecar = self.get_nodecar_sidecar(app_handle)?;
|
||||
for arg in &config_args {
|
||||
@@ -496,6 +503,7 @@ mod tests {
|
||||
assert_eq!(default_config.proxy, None);
|
||||
assert_eq!(default_config.fingerprint, None);
|
||||
assert_eq!(default_config.randomize_fingerprint_on_launch, None);
|
||||
assert_eq!(default_config.os, None);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user