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

Expose windowFeatures passed into window.open in IWebView2NewWindowRequestedEventArgs #70

Closed
michael-russin opened this issue Nov 16, 2019 · 7 comments
Labels
feature request feature request

Comments

@michael-russin
Copy link

Please expose the following parameters in IWebView2NewWindowRequestedEventArgs so the application hosting the new window can honor the settings passed from JavaScript into the window.open() call

  • height
  • width
  • x
  • y
  • fullscreen
  • location bar (address bar) visible
  • menu bar visible
  • scrollbars visible
  • status bar visible
  • toolbar visible

It would be similar to how CEF exposes CefPopupFeatures in CefLifeSpanHandler::OnBeforePopup

Thanks.

@david-risney david-risney added the feature request feature request label Nov 16, 2019
@david-risney
Copy link
Contributor

Thanks for the feedback! Do you need all of the windowfeatures values? What are you planning to do with them? Thanks!

@michael-russin
Copy link
Author

We just need x, y, height and width. We have a application that shows multiple web views hosting different web pages. One of them is scrolling news headlines and when a user clicks on a story link the web page passes size and location information for the story popup. We currently handle the new window event to provide a parent window that matches our application style and we use the position and size information to place the window.

@ukandrewc
Copy link

ukandrewc commented Nov 23, 2019

As a workaround, you can patch window.open():

//Patch window.open to get dimensions
(function (nativeOpen) {
  window.open = function (u, t, p) {
  //Parse parameters here
  return nativeOpen(u, t, p)
}
})(open)

@yildirimcagri-msft
Copy link
Member

yildirimcagri-msft commented Aug 11, 2020

The window features is now exposed to the NewWindowRequested event. Please see https://docs.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/0-9-538/icorewebview2experimentalnewwindowrequestedeventargs for reference. Please note that this API addition is currently experimental and let us know if this works for you. Thanks!

@ukandrewc
Copy link

This doesn't seem to have been exposed for Winforms?

@yildirimcagri-msft
Copy link
Member

We don't support exposing the experimental APIs to WinForms and WPF yet, however it's in our internal backlog. Feel free to create a separate GitHub issue if you'd like to track this. Thanks!

@ukandrewc
Copy link

Thanks, I'll wait, we don't have anything dependant on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request feature request
Projects
None yet
Development

No branches or pull requests

4 participants