Skip to content

[rust] Increase user awareness of their right to opt-out #15317

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions rust/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down Expand Up @@ -1674,3 +1676,18 @@ fn get_index_version(full_version: &str, index: usize) -> Result<String, Error>
.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(())
}
Loading