RuntimeClientAddBindingAsync Method |
Version 88.2.90
If executionContextId is empty, adds binding with the given name on the
global objects of all inspected contexts, including those created later,
bindings survive reloads.
Binding function takes exactly one argument, this argument should be string,
in case of any other input, function throws an exception.
Each binding function call produces Runtime.bindingCalled notification.
Namespace:
CefSharp.DevTools.Runtime
Assembly:
CefSharp (in CefSharp.dll) Version: 88.2.90.0 (88.2.90.0)
Syntax public Task<DevToolsMethodResponse> AddBindingAsync(
string name,
Nullable<int> executionContextId = null,
string executionContextName = null
)
public:
Task<DevToolsMethodResponse^>^ AddBindingAsync(
String^ name,
Nullable<int> executionContextId = nullptr,
String^ executionContextName = nullptr
)
Parameters
- name
- Type: SystemString
name - executionContextId (Optional)
- Type: SystemNullableInt32
If specified, the binding would only be exposed to the specifiedexecution context. If omitted and `executionContextName` is not set,the binding is exposed to all execution contexts of the target.This parameter is mutually exclusive with `executionContextName`. - executionContextName (Optional)
- Type: SystemString
If specified, the binding is exposed to the executionContext withmatching name, even for contexts created after the binding is added.See also `ExecutionContext.name` and `worldName` parameter to`Page.addScriptToEvaluateOnNewDocument`.This parameter is mutually exclusive with `executionContextId`.
Return Value
Type:
TaskDevToolsMethodResponsereturns System.Threading.Tasks.Task<DevToolsMethodResponse>
See Also