DevToolsExtensionsExecuteDevToolsMethodAsync Method (IChromiumWebBrowserBase, Int32, String, IDictionaryString, Object) |
Version 112.3.0
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.Core (in CefSharp.Core.dll) Version: 112.3.0.0
Syntax public static Task<int> ExecuteDevToolsMethodAsync(
this IChromiumWebBrowserBase chromiumWebBrowser,
int messageId,
string method,
IDictionary<string, Object> parameters = null
)
public:
[ExtensionAttribute]
static Task<int>^ ExecuteDevToolsMethodAsync(
IChromiumWebBrowserBase^ chromiumWebBrowser,
int messageId,
String^ method,
IDictionary<String^, Object^>^ parameters = nullptr
)
Parameters
- chromiumWebBrowser
- Type: CefSharpIChromiumWebBrowserBase
the ChromiumWebBrowser 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:
TaskInt32return 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
IChromiumWebBrowserBase. 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