MicrosoftEdge / MicrosoftEdge/WebView2Feedback

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

Open
#2,971 1 comment 0 reactions 2 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
PowerShell
Stars
526
Forks
67
PR merge metrics
No merged PRs in 30d

Description

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?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.