Click or drag to resize

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

Version 111.2.70
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 https://chromedevtools.github.io/devtools-protocol/ 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: 111.2.70.0 (111.2.70.0)
Syntax
public static Task<int> ExecuteDevToolsMethodAsync(
	this IBrowser browser,
	int messageId,
	string method,
	IDictionary<string, Object> parameters = null
)

Parameters

browser
Type: CefSharpIBrowser
the browser instance
messageId
Type: SystemInt32
is an incremental number that uniquely identifies the message (pass 0 to have the next number assigned automatically based on previous values)
method
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