diff --git a/wordpress.org/public_html/wp-content/themes/pub/wporg-support/js/forums.js b/wordpress.org/public_html/wp-content/themes/pub/wporg-support/js/forums.js
index 657dfc1..f172535 100644
--- a/wordpress.org/public_html/wp-content/themes/pub/wporg-support/js/forums.js
+++ b/wordpress.org/public_html/wp-content/themes/pub/wporg-support/js/forums.js
@@ -1,7 +1,24 @@
 ( function( $ ) {
+	if ( $( '#new-post' ).length ) {
+		let requireConfirmClose = false;
 
-	$( '#new-post' ).submit(function() {
-		$( '[type="submit"]', $(this) ).prop( 'disabled', 'disabled' );
-	});
+		$( '#new-post' ).submit( function() {
+			$( '[type="submit"]', $( this ) ).prop( 'disabled', 'disabled' );
 
-} )( window.jQuery );
+			requireConfirmClose = false;
+		} );
+
+		$( '#new-post' ).one( 'input', 'input[type=text], textarea', function() {
+			requireConfirmClose = true;
+		} );
+
+		window.addEventListener( 'beforeunload', function( e ) {
+			if ( requireConfirmClose ) {
+				e.preventDefault();
+
+				// Chrome requires returnValue to be set.
+				e.returnValue = '';
+			}
+		} );
+	}
+}( window.jQuery ) );
