diff --git a/rust/src/lib.rs b/rust/src/lib.rs index a2c2411bcb763..a3d510b185240 100644 --- a/rust/src/lib.rs +++ b/rust/src/lib.rs @@ -866,6 +866,8 @@ pub trait SeleniumManager { fn stats(&self) -> Result<(), Error> { if !self.is_avoid_stats() && !self.is_offline() { + let _report = first_report_msg(); + let props = Props { browser: self.get_browser_name().to_ascii_lowercase(), browser_version: self.get_browser_version().to_ascii_lowercase(), @@ -1674,3 +1676,18 @@ fn get_index_version(full_version: &str, index: usize) -> Result .ok_or(anyhow!(format!("Wrong version: {}", full_version)))? .to_string()) } + +fn first_report_msg() -> Result<(), Error> { + let cache_dir = default_cache_folder(); + let first_report_marker = cache_dir.join("initialized"); + + if !first_report_marker.exists() { + println!("\nSelenium Manager collects anonymous telemetry to improve the project."); + println!("Detailed information and instructions for opting out may be found at:"); + println!("https://www.selenium.dev/privacy/\n"); + + create_path_if_not_exists(&cache_dir)?; + fs::write(first_report_marker, "")?; + } + Ok(()) +}