Click or drag to resize

EmulationClientSetUserAgentOverrideAsync Method

Version 130.1.90
Allows overriding user agent with the given string. `userAgentMetadata` must be set for Client Hint headers to be sent.

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

Parameters

userAgent  String
User agent to use.
acceptLanguage  String  (Optional)
Browser language to emulate.
platform  String  (Optional)
The platform navigator.platform should return.
userAgentMetadata  UserAgentMetadata  (Optional)
To be sent in Sec-CH-UA-* headers and returned in navigator.userAgentData

Return Value

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