pub struct NavigatorProfile {
pub user_agent: String,
pub platform: String,
pub vendor: String,
pub hardware_concurrency: u8,
pub device_memory: u8,
pub max_touch_points: u8,
pub webgl_vendor: String,
pub webgl_renderer: String,
}Expand description
A bundle of navigator property values that together form a convincing browser identity.
All properties are validated at construction time to guarantee that
platform matches the OS fragment in user_agent.
§Example
use stygian_browser::stealth::NavigatorProfile;
let p = NavigatorProfile::mac_chrome();
assert_eq!(p.platform, "MacIntel");
assert!(p.user_agent.contains("Mac OS X"));Fields§
§user_agent: StringFull User-Agent string (navigator.userAgent and the HTTP header).
platform: StringPlatform string e.g. "Win32", "MacIntel", "Linux x86_64".
vendor: StringBrowser vendor ("Google Inc.").
hardware_concurrency: u8Logical CPU core count. Realistic values: 4, 8, 12, 16.
device_memory: u8Device RAM in GiB. Realistic values: 4, 8, 16.
max_touch_points: u8Maximum simultaneous touch points (0 = no touchscreen, 10 = tablet/phone).
webgl_vendor: StringWebGL vendor string (only used when StealthConfig::randomize_webgl is true).
webgl_renderer: StringWebGL renderer string.
Implementations§
Sourcepub fn windows_chrome() -> Self
pub fn windows_chrome() -> Self
A typical Windows 10 Chrome 120 profile.
Sourcepub fn mac_chrome() -> Self
pub fn mac_chrome() -> Self
A typical macOS Chrome 120 profile.
Sourcepub fn linux_chrome() -> Self
pub fn linux_chrome() -> Self
A typical Linux Chrome profile (common in data-centre environments).
Trait Implementations§
Source§fn clone(&self) -> NavigatorProfile
fn clone(&self) -> NavigatorProfile
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more