I am currently using faye for pubsub and am disconnecting the client on the beforeunload event.While it disconnects during tab close during page refresh it throws the following error :
The connection was interrupted while the page was loading
The code is
window.addEventListener('beforeunload',function(event){
fayeClient.disconnect();
event.preventDefault();});
Is there a way to stop firefox from closing the connection before the call completes.The above code works perfectly in chrome