sendBeacon request stuck as "(pending)" when attached to unload event : <p>When I call navigator.sendBeacon directly in the console, I immediately see the request in the Chrome dev tools Network pane complete successfully.</p>

<p>When I use code like what's below to attach sendBeacon to the beforeunload event and then navigate away from the page, I see a row added to the Network pane but its status stays stuck at "(pending)" and never sends.</p>

<p>What am I doing wrong?</p>

<pre><code>  window.addEventListener('beforeunload', function() {
    navigator.sendBeacon(
      'https://www.example.com/sendBeacon-data-collector',
      'Sent by a beacon!');
  }, false);
</code></pre>
