Closing Firefox/Opera tab does not trigger OnDisconnected event #2400

gustavo-armenta opened this Issue Aug 7, 2013 · 4 comments


None yet

5 participants


1. Add Microsoft.AspNet.SignalR.Samples\Hubs\HubConnectionAPI\HubConnectionAPI.cs on selfhost project in dev branch
2. Start selfhost project
3. Change sample to connect to the selfhost server by editing file Microsoft.AspNet.SignalR.Samples\Hubs\HubConnectionAPI\HubConnectionAPI.js
$.connection.hub.url = "http://localhost:8080/signalr";
4. On IE, navigate to http://localhost:40476/Hubs/HubConnectionAPI/Default.aspx
5. On Firefox, navigate to http://localhost:40476/Hubs/HubConnectionAPI/Default.aspx
6. Closing Firefox browser or closing Firefox tab does not trigger the OnDisconnected event (IE browser never sees the firefox client disconnected). Navigating to another page triggers OnDisconnected.

@halter73 halter73 was assigned Aug 7, 2013
@halter73 halter73 added a commit that referenced this issue Aug 9, 2013
@halter73 halter73 Make Firefox gracefully abort when a tab is closed
- This change is only needed for cross-omain scenarios
- This does not work when the entire browser window is closed


After latest fix:

  • Firefox triggers OnDisconnected when navigating to another webpage and closing the tab
  • Firefox does not trigger OnDisconnected when closing the browser
SignalR member

@gustavo-armenta Lets file a bug for this:

Firefox does not trigger OnDisconnected when closing the browser

And put it in the backlog


Is this still necessary for more recent versions of Firefox?

I commented out the if (isFirefox11OrGreater) { ... } block in jquery.signalR-2.2.1.js, and disconnection seemed to work (closed cleanly) on Firefox 49.


It would be good to know what version of Firefox it was enabled in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment