How to disable "Changes you made may not be saved." dialog box (Chrome)?
<p>A similar question has been answered (<a href="https://stackoverflow.com/questions/40425682/disable-changes-you-made-may-not-be-saved-pop-up-window">Disable &quot;Changes you made may not be saved&quot; pop-up window</a>), but somehow this still does not work for me.</p>

<p>I'm attempting to disable the <code>Changes you made may not be saved.</code> dialog box on form input changes. I know Chrome has removed the custom message capability, but I am having difficulty disabling the box altogether. I have the following javascript at the bottom of some HTML code:</p>

<pre><code>  window.onbeforeunload = function() {
  };

  window.onbeforeunload = null;
</code></pre>

<p>Neither of the two work for me. When I type <code>window.onbeforeunload</code> into the inspector console, I get a <code>null</code> return value. Can the <code>window.onbeforeunload = null;</code> be called anywhere within the lifespan of the page? Perhaps I'm misplacing it somewhere?</p>