WPF/WinForms/OffScreen - CanExecuteJavascriptInMainFrame incorrectly false after loading page with different origin

Proof of concept for a workaround. The frameId for the second OnContextReleased that arrives after the OnContextCreated from
the old render process strangely has a frameId greater than the new frameId

TODO: Unit tests

Issue #3021
This commit is contained in:
amaitland
2020-05-04 12:34:47 +10:00
parent 71a190dfe6
commit 1824a0334d
5 changed files with 60 additions and 6 deletions
+2 -2
View File
@@ -1048,7 +1048,7 @@ namespace CefSharp
{
if (frame->IsMain())
{
_browserControl->SetCanExecuteJavascriptOnMainFrame(true);
_browserControl->SetCanExecuteJavascriptOnMainFrame(frame->GetIdentifier(), true);
}
auto handler = _browserControl->RenderProcessMessageHandler;
@@ -1072,7 +1072,7 @@ namespace CefSharp
{
if (frame->IsMain())
{
_browserControl->SetCanExecuteJavascriptOnMainFrame(false);
_browserControl->SetCanExecuteJavascriptOnMainFrame(frame->GetIdentifier(), false);
}
auto handler = _browserControl->RenderProcessMessageHandler;