Module user_agent

Source
Expand description

Generate context data from user agent and client hints.

This module is responsible for taking the user agent string parsing it and filling in the browser, os and device information in the event.

§NOTICE

Adding user_agent parsing to your module will incur a latency penalty in the test suite. Because of this some integration tests may fail. To fix this, you will need to add a timeout to your consumer.

Structs§

ClientHints
The client hint variable names mirror the name of the “SEC-CH” headers.
RawUserAgentInfo
A container housing both the user-agent string and the client hint headers.

Traits§

FromUserAgentInfo
Computes a Context from either a user agent string and client hints.

Functions§

browser_from_client_hints
The sec-ch-ua field looks something like this: “Not_A Brand”;v=“99”, “Google Chrome”;v=“109”, “Chromium”;v=“109” The order of the items are randomly shuffled.
normalize_user_agent
Generates context data from client hints or user agent.
normalize_user_agent_info_generic
Low-level version of normalize_user_agent operating on parts.