Skip to content

Commit

Permalink
Always use IChromiumWebBrowserBase in WebBrowserExtensions where poss…
Browse files Browse the repository at this point in the history
…ible

to avoid conflicting overload resolutions with IWebBrowser
  • Loading branch information
campersau committed Jan 5, 2022
1 parent 604e957 commit a6b14b7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions CefSharp/WebBrowserExtensions.cs
Expand Up @@ -469,7 +469,7 @@ public static Task<LoadUrlAsyncResponse> LoadUrlAsync(IChromiumWebBrowserBase ch
/// <param name="methodName">The javascript method name to execute.</param>
/// <param name="args">the arguments to be passed as params to the method. Args are encoded using
/// <see cref="EncodeScriptParam"/>, you can provide a custom implementation if you require one.</param>
public static void ExecuteScriptAsync(this IWebBrowser browser, string methodName, params object[] args)
public static void ExecuteScriptAsync(this IChromiumWebBrowserBase browser, string methodName, params object[] args)
{
browser.BrowserCore.ExecuteScriptAsync(methodName, args);
}
Expand Down Expand Up @@ -877,7 +877,7 @@ public static void Reload(this IBrowser browser, bool ignoreCache = false)
/// <returns>
/// Cookie Manager.
/// </returns>
public static ICookieManager GetCookieManager(this IWebBrowser browser, ICompletionCallback callback = null)
public static ICookieManager GetCookieManager(this IChromiumWebBrowserBase browser, ICompletionCallback callback = null)
{
var host = browser.GetBrowserHost();

Expand Down Expand Up @@ -1430,7 +1430,7 @@ public static Task<JavascriptResponse> EvaluateScriptAsync(this IBrowser browser
/// <returns>
/// <see cref="Task{JavascriptResponse}"/> that can be awaited to perform the script execution.
/// </returns>
public static Task<JavascriptResponse> EvaluateScriptAsync(this IWebBrowser browser, string methodName, params object[] args)
public static Task<JavascriptResponse> EvaluateScriptAsync(this IChromiumWebBrowserBase browser, string methodName, params object[] args)
{
return browser.EvaluateScriptAsync(null, methodName, args);
}
Expand All @@ -1448,7 +1448,7 @@ public static Task<JavascriptResponse> EvaluateScriptAsync(this IWebBrowser brow
/// <returns>
/// <see cref="Task{JavascriptResponse}"/> that can be awaited to perform the script execution.
/// </returns>
public static Task<JavascriptResponse> EvaluateScriptAsync(this IWebBrowser browser, TimeSpan? timeout, string methodName, params object[] args)
public static Task<JavascriptResponse> EvaluateScriptAsync(this IChromiumWebBrowserBase browser, TimeSpan? timeout, string methodName, params object[] args)
{
var script = GetScriptForJavascriptMethodWithArgs(methodName, args);

Expand Down

0 comments on commit a6b14b7

Please sign in to comment.