MicrosoftEdge / MicrosoftEdge/WebView2Feedback

Webview2 crashes when calling document.write on newly opened window

Open
#3,491 5 comments 0 reactions 1 assignee 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

I had a similar issue prior to version 101.0.1210.8.

https://stackoverflow.com/questions/71851863/webview2-crashes-when-calling-document-write-on-newly-opened-window

This problem seems to have come back within the last month, although it doesn't appear on the simple test I created.

private void Wv_CoreWebView2InitializationCompleted(object sender, Microsoft.Web.WebView2.Core.CoreWebView2InitializationCompletedEventArgs e)
        {

            if (Deferral != null)
            {
                Args.NewWindow = wv.CoreWebView2;
                Deferral.Complete();
            }
            wv.CoreWebView2.NewWindowRequested += CoreWebView2_NewWindowRequested;
        }

Taking the last event handler, it seems to fail here "Args.NewWindow = wv.CoreWebView2;". If I put a break on that line and wait a second to continue, it works fine.

Any idea if this has been identified and when this is going to be fixed? Is there a workaround?

Thanks!

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.