use zendriver::{Browser, Persona, Seed, Strategy, Surface};
#[tokio::main]
#[allow(clippy::result_large_err)] async fn main() -> zendriver::Result<()> {
tracing_subscriber::fmt::init();
let persona = Persona::builder()
.seed(Seed::from_u64(42))
.device_memory_gb(8)
.timezone("America/New_York")
.build();
let browser = Browser::builder()
.persona(persona)
.surface(Surface::Webrtc, Strategy::Native)
.launch()
.await?;
let tab = browser.main_tab();
tab.goto("about:blank").await?;
tab.wait_for_load().await?;
let mem: serde_json::Value = tab.evaluate("navigator.deviceMemory").await?;
let tz: String = tab
.evaluate("Intl.DateTimeFormat().resolvedOptions().timeZone")
.await?;
println!("navigator.deviceMemory = {mem}");
println!("timezone = {tz}");
browser.close().await?;
Ok(())
}