Skip to content

Commit 288825d

Browse files
committed
Core - IFrame.EvaluateScriptAsPromiseAsync add javascriptBindingApiGlobalObjectName
- Defaults to null, only required if you set JavascriptBindingSettings.JavascriptBindingApiGlobalObjectName
1 parent 82d7ae7 commit 288825d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

CefSharp/WebBrowserExtensions.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1318,12 +1318,16 @@ public static Task<JavascriptResponse> EvaluateScriptAsPromiseAsync(this IBrowse
13181318
/// <param name="frame">The <seealso cref="IFrame"/> instance this method extends.</param>
13191319
/// <param name="script">The Javascript code that should be executed.</param>
13201320
/// <param name="timeout">(Optional) The timeout after which the Javascript code execution should be aborted.</param>
1321+
/// <param name="javascriptBindingApiGlobalObjectName">
1322+
/// Only required if a custom value was specified for <see cref="JavascriptBinding.JavascriptBindingSettings.JavascriptBindingApiGlobalObjectName"/>
1323+
/// then this param must match that value. Otherwise exclude passing a value for this param or pass in null.
1324+
/// </param>
13211325
/// <returns>
13221326
/// <see cref="Task{JavascriptResponse}"/> that can be awaited to perform the script execution.
13231327
/// </returns>
1324-
public static Task<JavascriptResponse> EvaluateScriptAsPromiseAsync(this IFrame frame, string script, TimeSpan? timeout = null)
1328+
public static Task<JavascriptResponse> EvaluateScriptAsPromiseAsync(this IFrame frame, string script, TimeSpan? timeout = null, string javascriptBindingApiGlobalObjectName = null)
13251329
{
1326-
var promiseHandlerScript = GetPromiseHandlerScript(script, null);
1330+
var promiseHandlerScript = GetPromiseHandlerScript(script, javascriptBindingApiGlobalObjectName);
13271331

13281332
return frame.EvaluateScriptAsync(promiseHandlerScript, timeout: timeout, useImmediatelyInvokedFuncExpression: true);
13291333
}

0 commit comments

Comments
 (0)