1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*!
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
```rust
use dioxus_document as document;
use browserinfo::{user_agent_js, UserAgent};
# async fn func() -> anyhow::Result<()> {
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)?;
# Ok(())
# }
```
### browser info
```rust
use dioxus_document as document;
use browserinfo::{broinfo_js, BroInfo, Browser};
# async fn func() -> anyhow::Result<()> {
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();
# Ok(())
# }
```
*/
pub use *;