Skip to content

Commit 8ff2041

Browse files
committed
Disable CanExecuteJavascriptInMainFrame checks for ExecuteScriptAsync/EvaluateScriptAsync
See #2250 for details (appears to be bug in `CEF`)
1 parent 9699083 commit 8ff2041

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

CefSharp/WebBrowserExtensions.cs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -208,10 +208,11 @@ public static void ExecuteScriptAsync(this IWebBrowser browser, string methodNam
208208
/// <param name="script">The Javascript code that should be executed.</param>
209209
public static void ExecuteScriptAsync(this IWebBrowser browser, string script)
210210
{
211-
if (browser.CanExecuteJavascriptInMainFrame == false)
212-
{
213-
ThrowExceptionIfCanExecuteJavascriptInMainFrameFalse();
214-
}
211+
//TODO: Re-enable when Native IPC issue resolved.
212+
//if (browser.CanExecuteJavascriptInMainFrame == false)
213+
//{
214+
// ThrowExceptionIfCanExecuteJavascriptInMainFrameFalse();
215+
//}
215216

216217
using (var frame = browser.GetMainFrame())
217218
{
@@ -779,10 +780,11 @@ public static Task<JavascriptResponse> EvaluateScriptAsync(this IWebBrowser brow
779780
throw new ArgumentOutOfRangeException("timeout", "Timeout greater than Maximum allowable value of " + UInt32.MaxValue);
780781
}
781782

782-
if(browser.CanExecuteJavascriptInMainFrame == false)
783-
{
784-
ThrowExceptionIfCanExecuteJavascriptInMainFrameFalse();
785-
}
783+
//TODO: Re-enable when Native IPC issue resolved.
784+
//if(browser.CanExecuteJavascriptInMainFrame == false)
785+
//{
786+
// ThrowExceptionIfCanExecuteJavascriptInMainFrameFalse();
787+
//}
786788

787789
using (var frame = browser.GetMainFrame())
788790
{

0 commit comments

Comments
 (0)