use html_view::ViewerOptions;
use url::Url;
fn main() -> Result<(), Box<dyn std::error::Error>> {
println!("Remote URL Example");
println!("==================\n");
println!("Opening Rust documentation...\n");
let url = Url::parse("https://doc.rust-lang.org/book/")?;
let mut options = ViewerOptions::remote_url(url);
options.behaviour.allow_remote_content = true;
options.behaviour.allow_external_navigation = true;
options.behaviour.allowed_domains = Some(vec![
"doc.rust-lang.org".to_string(),
"rust-lang.org".to_string(),
]);
options.window.title = Some("Rust Documentation".to_string());
options.window.width = Some(1200);
options.window.height = Some(900);
options.behaviour.enable_devtools = true;
println!("Security settings:");
println!(" - Remote content: ENABLED");
println!(" - External navigation: ENABLED");
println!(" - Allowed domains: rust-lang.org, doc.rust-lang.org");
println!(" - DevTools: ENABLED\n");
println!("Window will open shortly...");
println!("You can navigate within allowed domains.");
println!("Press F12 to open DevTools and inspect network requests.\n");
html_view::open(options)?;
println!("Viewer closed!");
Ok(())
}