Permalink
Browse files

Fix failed connection under OS X when no top-level window open. (Cont…

…ributed by Dan Colascione)
  • Loading branch information...
1 parent 552ed9b commit 75fd4c33ac8831697a8b203e02529aa1add6f877 @bard bard committed Nov 14, 2011
Showing with 7 additions and 0 deletions.
  1. +7 −0 chrome/content/server.js
View
@@ -121,6 +121,13 @@ function onSocketAccepted(serv, transport) {
.getService(Ci.nsIWindowMediator)
.getMostRecentWindow(typeof(contextWindowType) !== 'undefined' ?
contextWindowType : pref.getCharPref('startingContext'));
+
+ if(context === null) {
+ context = Cc["@mozilla.org/appshell/appShellService;1"]
+ .getService(Ci.nsIAppShellService)
+ .hiddenDOMWindow.wrappedJSObject;
+ }
+
var session = new REPL();
session.onOutput = function(string) {
outstream.write(string, string.length);

0 comments on commit 75fd4c3

Please sign in to comment.