Skip to content

ExecuteScriptAsync does not return after a GetDeferral is called in a NewWindowRequested  #2971

Open
@darbid

Description

@darbid

Description
ExecuteScriptAsync never returns after a GetDeferral is called in a NewWindowRequested

Version
SDK: 1.0.1369
Runtime: 107.0.1418.42
Framework: WPF
OS: Win10

Repro Steps
In a standard project add this in the event NewWindowRequested

private async void CoreWebView2_NewWindowRequested(object sender, CoreWebView2NewWindowRequestedEventArgs e)
{
            e.Handled = true;
            var deferral = e.GetDeferral();
            var res = await this.Browser.ExecuteScriptAsync("console.log('test'); return true;");
}

In my tests nothing is shown in dev tools for console.log and ExecuteScriptAsync never returns.

Is this intended?

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions