pub static BROWSER_INSTANCE: std::sync::LazyLock<Option<std::process::Child>> =
std::sync::LazyLock::new(|| {
let url = format!(
"file://{}/tests/index.html",
std::env::current_dir().unwrap().to_str().unwrap()
);
let child = if cfg!(target_os = "windows") {
std::process::Command::new("cmd")
.args(["/C", "start", "firefox", "--kiosk", &url])
.spawn()
.expect("Failed to start Firefox")
} else if cfg!(target_os = "macos") {
std::process::Command::new("open")
.args(["-a", "Firefox", "--args", "--kiosk", &url])
.spawn()
.expect("Failed to start Firefox")
} else {
std::process::Command::new("firefox")
.args(["--kiosk", &url])
.spawn()
.expect("Failed to start Firefox")
};
Some(child)
});