set_user_agent_prefix(
key: str,
prefix: 'str | Callable[[], str]',
) -> None| Name | Type | Description |
|---|---|---|
key* | str | Stable identifier for the registration. |
prefix* | 'str | Callable[[], str]' | The token or token provider to emit. An empty string removes the registration. |
Register or replace a named UA prefix.
The key retains its insertion position when its value changes, allowing
feature-bearing prefixes to evolve without leaving stale tokens behind.
Callable prefixes are resolved each time :func:get_user_agent runs.