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

beforeunload must return a string and not prompt anything #40

Closed
rudiedirkx opened this issue Dec 16, 2011 · 1 comment
Closed

beforeunload must return a string and not prompt anything #40

rudiedirkx opened this issue Dec 16, 2011 · 1 comment

Comments

@rudiedirkx
Copy link

It would be insanely annoying and obtrusive if the browser could hassle the client with custom confirm() popups onbeforeunload and choose if the user can close this window. (The user should have (and has) that power.)

The app now tries to prompt. Incorrect. Chrome dev tools tell me this: http://screencast.com/t/wzHmfxJG3c

Correct: https://developer.mozilla.org/en/DOM/window.onbeforeunload

window.onbeforeunload = function() {
  return 'You have unsaved changes. Are you sure?'
}
@LeaVerou
Copy link
Owner

THANK you! That will solve #30! Closing this though as it's a duplicate (github should really have a merge feature)

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

No branches or pull requests

2 participants