Skip to content

Commit

Permalink
fix: add a check for debug view with socket.io
Browse files Browse the repository at this point in the history
Closes #11
  • Loading branch information
pablojim authored and Fitzgerald Barry committed Dec 5, 2013
1 parent 55b9280 commit 72e8695
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,13 @@ var indexOf = function(collection, item) {

// TODO(vojta): Karma might provide this
var getCurrentTransport = function() {
// probably running in debug.html (there's no socket.io)
if (!window.parent.io) {
var location = window.parent.location;

// probably running in debug.html (there's no socket.io) or in debug mode with socket io but no socket on this host
if (!window.parent.io || !window.parent.io.sockets[location.protocol + '//' + location.host]) {
return null;
}

var location = window.parent.location;
return window.parent.io.sockets[location.protocol + '//' + location.host].transport.name;
};

Expand Down

0 comments on commit 72e8695

Please sign in to comment.