Permalink
Browse files

Respect "allow outside connections" preference.

  • Loading branch information...
1 parent 646208b commit 86bf1fae6ecfaf58b6a265ec74d1f1da2b31cd38 @bard bard committed Dec 14, 2011
Showing with 12 additions and 9 deletions.
  1. +2 −3 chrome/content/overlay_impl.js
  2. +2 −1 chrome/content/server.js
  3. +6 −4 chrome/content/ui.js
  4. +2 −1 components/CommandLine.js
@@ -65,12 +65,11 @@ function togglePref(prefName) {
}
function toggleServer(sourceCommand) {
- var port = pref.getIntPref('port');
-
if(server.isActive())
server.stop();
else
- server.start(port);
+ server.start(pref.getIntPref('port'),
+ pref.getBoolPref('loopbackOnly'));
}
function updateMenu(xulPopup) {
View
@@ -173,7 +173,8 @@ function observe(subject, topic, data) {
srvObserver.addObserver(this, 'network:offline-status-changed', false);
if(srvPref.getBranch('network.').getBoolPref('online') &&
pref.getBoolPref('autoStart'))
- this.start(pref.getIntPref('port'));
+ this.start(pref.getIntPref('port'),
+ pref.getBoolPref('loopbackOnly'));
break;
case 'network:offline-status-changed':
View
@@ -37,18 +37,20 @@ function constructor(server) {
}
function toggleServer(sourceCommand) {
- var port = Components
+ var pref = Components
.classes['@mozilla.org/preferences-service;1']
.getService(Components.interfaces.nsIPrefService)
- .getBranch('extensions.mozrepl.')
- .getIntPref('port');
+ .getBranch('extensions.mozrepl.');
+
+ var port = pref.getIntPref('port');
+ var loopbackOnly = pref.getBoolPref('loopbackOnly');
if(this._server.isActive()) {
this._server.stop();
sourceCommand.setAttribute('label', 'Start Repl');
}
else {
- this._server.start(port);
+ this._server.start(port, loopbackOnly);
sourceCommand.setAttribute('label', 'Stop Repl');
}
}
@@ -63,6 +63,7 @@ MozReplCommandLineHandler.prototype = {
if(start || contextWindowType) {
var port = Number(cmdLine.handleFlagWithParam('repl', false)) ||
srvPref.getIntPref('port');
+ var loopbackOnly = srvPref.getBoolPref('loopbackOnly');
var service = Cc['@hyperstruct.net/mozlab/mozrepl;1']
.getService(Ci.nsIMozRepl)
@@ -71,7 +72,7 @@ MozReplCommandLineHandler.prototype = {
if(contextWindowType)
service.setContextWindowType(contextWindowType);
- service.start(port);
+ service.start(port, loopbackOnly);
}
},

0 comments on commit 86bf1fa

Please sign in to comment.