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

love.event.quit() causes crash but doesn't close tab #70

Open
FormularSumo opened this issue Oct 5, 2022 · 5 comments
Open

love.event.quit() causes crash but doesn't close tab #70

FormularSumo opened this issue Oct 5, 2022 · 5 comments

Comments

@FormularSumo
Copy link

FormularSumo commented Oct 5, 2022

Calling love.event.quit() or love.event.quit("restart") causes love.js to crash. Ideally it should close the tab similar to how native love2d closes the game window.

@Davidobot
Copy link
Owner

You're free to call JS' window.close(); via the JS player

@FormularSumo
Copy link
Author

Is there a way it doing that from within love2d? I feel like it'd make the most sense for love.event.quit() to call the window.close; function but I'm not sure how hard that would be to do.

@Davidobot
Copy link
Owner

See #26

@FormularSumo
Copy link
Author

Got that working but window.close(); only works if the current tab was opened via the same script (eg using window.open();), so I guess there isn't really a way for love.js to implment the love.event.quite function properly

@ChicknTurtle
Copy link

This works for me on Opera GX, but not on Chrome:

window.open('', '_self', '');
window.close();

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

No branches or pull requests

3 participants