browserinfo 0.1.5

browser and hardware information.
Documentation

browserinfo

crate Docs Rust Version Apache2/MIT licensed Test ubu Test mac Test win

Provides the javascript string and rust struct that are required when running javascript and collecting information.

How to use

In dioxus, it is used as follows.

user agent

use dioxus_document as document;
use browserinfo::{user_agent_js, UserAgent};

let js_ua: &str = user_agent_js();
let eval = document::eval(js_ua).await?;
let json_str = eval.to_string();
let user_agent = UserAgent::from_json_str(&json_str)?;

browser info

use dioxus_document as document;
use browserinfo::{broinfo_js, BroInfo, Browser};

let js_bro: &str = broinfo_js();
let eval = document::eval(js_bro).await?;
let json_str = eval.to_string();
let broinfo = BroInfo::from_json_str(&json_str)?;

// Generate `Browser` from `UserAgent`
let browser = broinfo.to_browser();

Changelogs

This crate's changelog here.

License

This project is licensed under either of

at your option.