Click or drag to resize

DevToolsExtensionsExecuteDevToolsMethodAsync Method (IBrowser, Int32, String, IDictionaryString, Object)

Version 102.0.100
Execute a method call over the DevTools protocol. This is a more structured version of SendDevToolsMessage. ExecuteDevToolsMethod(IBrowserHost, Int32, String, JsonString) can only be called on the CEF UI Thread, this method can be called on any thread. See the DevTools protocol documentation at for details of supported methods and the expected parameters dictionary contents. See the SendDevToolsMessage documentation for additional usage information.

Namespace:  CefSharp
Assembly:  CefSharp (in CefSharp.dll) Version: (
public static Task<int> ExecuteDevToolsMethodAsync(
	this IBrowser browser,
	int messageId,
	string method,
	IDictionary<string, Object> parameters = null


Type: CefSharpIBrowser
the browser instance
Type: SystemInt32
is an incremental number that uniquely identifies the message (pass 0 to have the next number assigned automatically based on previous values)
Type: SystemString
is the method name
parameters (Optional)
Type: System.Collections.GenericIDictionaryString, Object
are the method parameters represented as a dictionary, which may be empty.

Return Value

Type: TaskInt32
return a Task that can be awaited to obtain the assigned message Id. If the message was unsuccessfully submitted for validation, this value will be 0.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IBrowser. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also