title: Node - Push notification when browser closed
body: <p>I'm new to node and socket.io. I just have done a chrome extension with push notification. In that i'm facing a issue the notification is not sending when chrome browser closed. The server notifies something like below and the notification is not sending.</p>
  
  <pre><code>info  - transport end (socket end)
  debug - set close timeout for client kgcuzAOgn5-lrnuQI0Qb
  debug - cleared close timeout for client kgcuzAOgn5-lrnuQI0Qb
  debug - cleared heartbeat interval for client kgcuzAOgn5-lrnuQI0Qb
  debug - discarding transport
  </code></pre>
  
  <p>here is my code</p>
  
  <p>server</p>
  
  <pre><code>io.sockets.on( 'connection', function ( socket ) {
  fs.watch( 'example.xml', function ( curr, prev ) {
    fs.readFile( 'example.xml', function ( err, data ) {
      if ( err ) throw err;    
    parser.parseString( data );
  });
   });
  
    parser.addListener('end', function( result ) {
  
      // adding the time of the latest update
      //result.time = new Date();
      socket.volatile.emit( 'notification' , result );
    });
  });
  </code></pre>
  
  <p>Client </p>
  
  <pre><code>var socket = new io.connect('http://website:8000');
  console.log('client connected');
  
  socket.on('notification', function(data){
  console.log("message recieved1 = "+data);
  
      console.log("message recieved = "+data);
      showNotification(data)
      chrome.browserAction.setBadgeText({ text : "1" });
  
  
  });
  
   function showNotification(data){ 
  var havePermission = window.webkitNotifications.checkPermission();
    if (havePermission == 0) {
      // 0 is PERMISSION_ALLOWED     
  
  var notification = webkitNotifications.createNotification(
    'http://website.com/favicon.ico',  // icon url - can be relative
    'Hello!',  // notification title
    data  // notification body text
  );
  // Hide the notification after the configured duration.
      //setTimeout(function(){ notification.cancel(); }, 5000);
  
      notification.onclick = function () {
        window.open("http://website.com/favicon.gif");
        notification.close();
       resetBadgeText();
      }
     chrome.browserAction.setBadgeText({"text":"1"});
      notification.show();
    } else {
        window.webkitNotifications.requestPermission();
    }
   }
  </code></pre>
  
  <p>Pls help me to solve this issue.</p>