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

Close Window Via window.close() #66

Closed
9ParsonsB opened this issue Jun 23, 2021 · 5 comments
Closed

Close Window Via window.close() #66

9ParsonsB opened this issue Jun 23, 2021 · 5 comments
Labels
All OS All operating systems question Further information is requested

Comments

@9ParsonsB
Copy link

In CoreWebView2 you are able to listen to event CoreWebView2.WindowCloseRequested for when window.close() is called in javascript.

As per the dom-window-close spec this function is allowed:

if it is a top-level browsing context whose session history contains only one Document.

Could this functionality please be implemented?

@MikeYeager MikeYeager added All OS All operating systems question Further information is requested labels Jun 24, 2021
@MikeYeager
Copy link
Collaborator

In the upcoming V2 there is a Closing event raised for the native window (which can even prevent the window from closing). There is also the built-in browser event for closing the webview control that can be used in JavaScript. Can you explain your scenario? Do you want to write a JavaScript handler or a C# handler? Thanks.

@9ParsonsB
Copy link
Author

9ParsonsB commented Jun 26, 2021

Hey, Thanks for your reply, love the project!

The Scenario is a full screen kiosk-style app that shows an animated webpage while it is doing some work in the background - in C#. Once this is done, the application closes the window and runs another application.

We are also looking at using photino for the aforementioned other application, but then we would need to be able to close the current window from javascript. This works if you run most browsers (as per spec) with an url as a parameter and dont navigate away.

This feature would also help circumvent the issues I am having as a result of tryphotino/photino.NET#52

@ottodobretsberger
Copy link
Contributor

This should be fixed with the release of Photino v2. Please give it a try and let us know if the problem remains.

@9ParsonsB
Copy link
Author

@ottodobretsberger Where can I get v2? I dont see a git tag?

@MikeYeager
Copy link
Collaborator

The V2 NuGet packages are available for use from NuGet.org. For source code, pull the latest 'master' branch in GitHub. We did not add tags.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
All OS All operating systems question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants