You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a webpage opens a new window using window.open, the WebView2 defaults to open a new window which it creates and handles, similar to in MS Edge. Developers can override this behaviour in the WebView2 so that they can provide their own behaviour. However, it would be really advantageous if we could just have some customisability over the default window, so that we don't have to create our own window from scratch just to change one thing or be subscribe to an event. At the moment it kind of feels like a rouge window that, despite technically being part of the developer's app, they have no control over.
Perhaps the NewWindowRequested args could give us a WebView2 object for the default window, or some other object we could use to interface with it?
This is the window I am referring to:
The scenario/use case where you would use this feature
Specifically, this came to mind as I have an app with a WebView2 in a WPF app which has TopMost set to true on the window which uses it, and when the webpage opens a new window, the new window appears behind the app's window due to it not inheriting TopMost. If I could control whether the external window was TopMost, or could detect when the window opens and disable TopMost on my window until the new window closes, that would fix this issue.
Of course, there could be plenty of use cases for this, such as customising the window, responding to certain events to enable custom behaviour, etc. without the need to create a new window manually (may as well reuse the one that is already created).
How important is this request to you?
Nice to have. There are other ways to tackle this, but having official API support would be beneficial.
Suggested implementation
No response
What does your app do? Is there a pending deadline for this request?
No response
The text was updated successfully, but these errors were encountered:
@sivMSFT At the moment the solution is to create a custom window and apply the attributes to it specified in the NewWindowRequested event arguments, which is fine, I just thought since the WebView2 has the behaviour for showing web windows built-in, may as well use that if it's available.
Describe the feature/enhancement you need
When a webpage opens a new window using window.open, the WebView2 defaults to open a new window which it creates and handles, similar to in MS Edge. Developers can override this behaviour in the WebView2 so that they can provide their own behaviour. However, it would be really advantageous if we could just have some customisability over the default window, so that we don't have to create our own window from scratch just to change one thing or be subscribe to an event. At the moment it kind of feels like a rouge window that, despite technically being part of the developer's app, they have no control over.
Perhaps the NewWindowRequested args could give us a WebView2 object for the default window, or some other object we could use to interface with it?
This is the window I am referring to:
The scenario/use case where you would use this feature
Specifically, this came to mind as I have an app with a WebView2 in a WPF app which has TopMost set to true on the window which uses it, and when the webpage opens a new window, the new window appears behind the app's window due to it not inheriting TopMost. If I could control whether the external window was TopMost, or could detect when the window opens and disable TopMost on my window until the new window closes, that would fix this issue.
Of course, there could be plenty of use cases for this, such as customising the window, responding to certain events to enable custom behaviour, etc. without the need to create a new window manually (may as well reuse the one that is already created).
How important is this request to you?
Nice to have. There are other ways to tackle this, but having official API support would be beneficial.
Suggested implementation
No response
What does your app do? Is there a pending deadline for this request?
No response
The text was updated successfully, but these errors were encountered: