title: How to detect browser disconnect in firebase backend from browser crashes
body: <p>Browsers will send disconnect messages to firebase when they are closed normally but I want to account for crashes.</p>
  
  <pre><code>var presenceRef = new Firebase('https://SampleChat.firebaseIO-demo.com/disconnectmessage');
  // Write a string when I lose my connection
  presenceRef.onDisconnect().set("I disconnected!");
  </code></pre>
  
  <p>How would I best detect disconnects in firebase from browser crashes?</p>