{"issue":{"state":"closed","pull_request":{"diff_url":null,"html_url":null,"patch_url":null},"milestone":null,"user":{"avatar_url":"https://secure.gravatar.com/avatar/1d4f4ae43b9e342e928661a9c244fece?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"1d4f4ae43b9e342e928661a9c244fece","url":"https://api.github.com/users/dcolascione","login":"dcolascione","id":331322},"labels":[],"assignee":null,"updated_at":"2011-11-14T14:56:58Z","comments":1,"closed_at":"2011-11-14T14:56:58Z","url":"https://api.github.com/repos/bard/mozrepl/issues/23","body":"diff --git a/chrome/content/server.js b/chrome/content/server.js\r\nindex fdfa2a8..cdbbf63 100644\r\n--- a/chrome/content/server.js\r\n+++ b/chrome/content/server.js\r\n@@ -121,6 +121,13 @@ function onSocketAccepted(serv, transport) {\r\n         .getService(Ci.nsIWindowMediator)\r\n         .getMostRecentWindow(typeof(contextWindowType) !== 'undefined' ?\r\n                              contextWindowType : pref.getCharPref('startingContext'));\r\n+\r\n+    if(context === null) {\r\n+        context = Cc[\"@mozilla.org/appshell/appShellService;1\"]\r\n+            .getService(Ci.nsIAppShellService)\r\n+            .hiddenDOMWindow.wrappedJSObject;\r\n+    }\r\n+    \r\n     var session = new REPL();\r\n     session.onOutput = function(string) {\r\n         outstream.write(string, string.length);\r\n\r\n","html_url":"https://github.com/bard/mozrepl/issues/23","title":"Connect fails under OS X when no top-level window open","number":23,"id":2226295,"created_at":"2011-11-14T06:05:53Z"},"action":"closed"}