Crate fake_user_agent

source ·
Expand description

A simple library for getting random user agents from a list of popular browsers such as Chrome, Firefox, Safari, Opera, Edge, and Internet Explorer.

The user agents are hard-coded into the binary. They can be found here.


Get a random user agent from Chrome, Opera, Firefox, Safari, Edge, or Internet Explorer:

use fake_user_agent::get_rua;
let rua = get_rua(); // String

If you want a specific type of browser user agent, you can use the following:

Get a random Chrome user agent:

use fake_user_agent::get_chrome_rua;
let rua = get_chrome_rua(); // String

Get a random Opera user agent:

use fake_user_agent::get_opera_rua;
let rua = get_opera_rua(); // String

Get a random Firefox user agent:

use fake_user_agent::get_firefox_rua;
let rua = get_firefox_rua(); // String

Get a random Safari user agent:

use fake_user_agent::get_safari_rua;
let rua = get_safari_rua(); // String

Get a random Edge user agent:

use fake_user_agent::get_edge_rua;
let rua = get_edge_rua(); // String

Get a random Internet Explorer user agent:

use fake_user_agent::get_ie_rua;
let rua = get_ie_rua(); // String