Click or drag to resize

EmulationClientSetUserAgentOverrideAsync Method

Version 101.0.180
Allows overriding user agent with the given string.

Namespace:  CefSharp.DevTools.Emulation
Assembly:  CefSharp (in CefSharp.dll) Version: 101.0.180.0 (101.0.180.0)
Syntax
public Task<DevToolsMethodResponse> SetUserAgentOverrideAsync(
	string userAgent,
	string acceptLanguage = null,
	string platform = null,
	UserAgentMetadata userAgentMetadata = null
)

Parameters

userAgent
Type: SystemString
User agent to use.
acceptLanguage (Optional)
Type: SystemString
Browser langugage to emulate.
platform (Optional)
Type: SystemString
The platform navigator.platform should return.
userAgentMetadata (Optional)
Type: CefSharp.DevTools.EmulationUserAgentMetadata
To be sent in Sec-CH-UA-* headers and returned in navigator.userAgentData

Return Value

Type: TaskDevToolsMethodResponse
returns System.Threading.Tasks.Task<DevToolsMethodResponse>
See Also