Skip to content

Disable beforeUnload during app mode #584

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

Closed
wants to merge 2 commits into from
Closed

Conversation

nol166
Copy link
Contributor

@nol166 nol166 commented Apr 24, 2019

Describe in detail the problem you had and how this PR fixes it

When code-server is running in app mode, the close window confirmation is annoying and unnecessary. This change prevents that behavior if in app mode.

Is there an open issue you can link to?

fixes #574

@nol166 nol166 requested review from kylecarbs and code-asher April 24, 2019 15:58
e.preventDefault(); // FireFox
e.returnValue = ""; // Chrome
});
if (!window.matchMedia("(display-mode: standalone)").matches) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't match fullscreen. Is there a cleaner way to check if we're in a minified window mode?

https://developer.mozilla.org/en-US/docs/Web/CSS/@media/display-mode#Syntax

Copy link
Contributor Author

@nol166 nol166 Apr 24, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fullscreen mode would still have the problem where control + w closes the browser window, correct?

@nol166 nol166 requested a review from kylecarbs April 25, 2019 18:19
@sr229
Copy link
Contributor

sr229 commented Sep 12, 2019

Obsoleted by GH-857.

@sr229 sr229 closed this Sep 12, 2019
@code-asher code-asher deleted the fix/PWA-close-prompt branch January 16, 2020 16:46
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

Successfully merging this pull request may close these issues.

window.beforeclose prompt should not alert if running in app mode in chrome
3 participants