diff --git a/packages/editor/src/components/post-locked-modal/index.js b/packages/editor/src/components/post-locked-modal/index.js index b9c8de97f3d93e..8c6417ae403c82 100644 --- a/packages/editor/src/components/post-locked-modal/index.js +++ b/packages/editor/src/components/post-locked-modal/index.js @@ -121,9 +121,13 @@ class PostLockedModal extends Component { data.append( 'post_ID', postId ); data.append( 'active_post_lock', activePostLock ); - const xhr = new window.XMLHttpRequest(); - xhr.open( 'POST', postLockUtils.ajaxUrl, false ); - xhr.send( data ); + if ( window.navigator.sendBeacon ) { + window.navigator.sendBeacon( postLockUtils.ajaxUrl, data ); + } else { + const xhr = new window.XMLHttpRequest(); + xhr.open( 'POST', postLockUtils.ajaxUrl, false ); + xhr.send( data ); + } } render() {