setUserAgentOverride method
Future<void>
setUserAgentOverride(
- String userAgent, {
- String? acceptLanguage,
- String? platform,
- UserAgentMetadata? userAgentMetadata,
Allows overriding user agent with the given string.
userAgent
User agent to use.
acceptLanguage
Browser langugage to emulate.
platform
The platform navigator.platform should return.
userAgentMetadata
To be sent in Sec-CH-UA-* headers and returned in navigator.userAgentData
Implementation
Future<void> setUserAgentOverride(String userAgent,
{String? acceptLanguage,
String? platform,
UserAgentMetadata? userAgentMetadata}) async {
await _client.send('Emulation.setUserAgentOverride', {
'userAgent': userAgent,
if (acceptLanguage != null) 'acceptLanguage': acceptLanguage,
if (platform != null) 'platform': platform,
if (userAgentMetadata != null) 'userAgentMetadata': userAgentMetadata,
});
}