Make WordPress Core

Opened 10 years ago

Last modified 5 years ago

#28566 new enhancement

Add our own "Are you sure you want to leave this page?" message when possible

Reported by: iseulde's profile iseulde Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Editor Keywords:
Focuses: ui Cc:


We could do that by listening for clicks on the page that would unload it. Unfortunately it's not possible to display our own dialog when navigating away with the browser, but I think having our own dialog half of the time is better than nothing.

I quite like how FaceBook has done something similar. For the editor, we could have an extra button to save the post.

See also the usability test @designsimply has done for the front-end editor.

Attachments (1)

Screen Shot 2014-06-17 at 09.02.46.png (50.9 KB) - added by iseulde 10 years ago.

Download all attachments as: .zip

Change History (8)

#1 @SergeyBiryukov
10 years ago

  • Type changed from defect (bug) to enhancement

#2 @helen
9 years ago

  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to Future Release


#3 follow-up: @ryan
9 years ago

All of our AYS type dialogs need improvement. +1

This ticket was mentioned in Slack in #core by helen. View the logs.

9 years ago

#5 in reply to: ↑ 3 @swissspidy
9 years ago

All of our AYS type dialogs need improvement. +1

Related: #34816, where we discussed creating generic functionality for such dialogs.

This ticket was mentioned in Slack in #core-editor by iseulde. View the logs.

8 years ago

#7 @danieliser
8 years ago

Another option here, maybe even an enhancement would be to use the new navigator.sendBeacon function in chrome to auto save. IE user can enable an auto save function in chrome that will auto save upon leaving the page. Similar to onBeforeUnload but non blocking.

Although it is currently a Chrome webkit only enhancement, this has already been proposed in Mozilla and MS Cortana. Thus making it a good option to consider now.

Here is an example how it can be used when supported or fallback to AJAX non blocking request if not.

Note: See TracTickets for help on using tickets.