title: How to detect browser force refresh event - Cross Browser
body: <p>I want to detect force refresh event  on JavaScript. When user click on browser reload button or press <kbd>Ctrl</kbd> + <kbd>f5</kbd> (on Windows) / <kbd>Cmd</kbd> + <kbd>r</kbd> (on Mac) and  <kbd>refresh</kbd> on mobile device.</p>
  
  <p>I tried <code>beforeunload</code> event but this event trigger on every page load and navigating to other page.</p>
  
  <pre><code>window.addEventListener('beforeunload', function (event) {
     // This not working exactly what I want.
  })
  </code></pre>