Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

webview object not found on the same domain assigning corewebview2 in NewWindowRequested event handler #1144

Closed
froggy96 opened this issue Apr 3, 2021 · 3 comments
Labels
bug Something isn't working tracked We are tracking this work internally.

Comments

@froggy96
Copy link

froggy96 commented Apr 3, 2021

Description

Version
SDK: 1.0.774.44
Runtime: v4.0.30319
Framework: WinForms
OS: Win10 Pro

Repro Steps

  1. Make an html to open a new window targeting resource within same domain
    ex) window.open("test.html", "_blank");

  2. Set corewebview2 object in NewWindowRequested event.

private void CoreWebView2_NewWindowRequested(object sender, CoreWebView2NewWindowRequestedEventArgs e)
{
            e.NewWindow = WebView2.CoreWebView2;
            e.Handled = true;
 }

  1. Then corewebview2 object contains the new resource (test.html here).

  2. Open devtool to check window.chrome.webview object is established --> false!

  3. If you change the target on [Step 1] from "_blank" to "_top", window.chrome.webview is established.

  4. Is it a bug? or am I doing something wrong?

[error]
error

[ok]
fine

Additional context

AB#32377050

@froggy96 froggy96 added the bug Something isn't working label Apr 3, 2021
@froggy96
Copy link
Author

froggy96 commented Apr 3, 2021

Another one.
If you open a new window sourcing from OTHER domain (different url such as, http://microsof.com)
It's fine, window.chrome.webview object is established normally.

@champnic
Copy link
Member

champnic commented Apr 5, 2021

Agreed - this looks like a bug to me as well. I've opened it on our backlog to take a look. Thanks!

@champnic champnic added the tracked We are tracking this work internally. label Apr 5, 2021
@champnic
Copy link
Member

champnic commented Oct 7, 2021

This is fixed in runtimes 94.0.996.0+. Thanks!

@champnic champnic closed this as completed Oct 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working tracked We are tracking this work internally.
Projects
None yet
Development

No branches or pull requests

2 participants