Permalink
Browse files

Allow switching off welcome message through pref.

  • Loading branch information...
1 parent fb7072c commit 589fbc252cb9c54bfe5e4791a0aa1294c9afb29b @bard bard committed Jul 19, 2011
Showing with 15 additions and 12 deletions.
  1. +14 −12 chrome/content/repl.js
  2. +1 −0 defaults/preferences/mozrepl.js
View
@@ -546,18 +546,20 @@ var javascriptInteractor = {
onStart: function(repl) {
this._inputBuffer = '';
- repl.print('');
- repl.print('Welcome to MozRepl.');
- repl.print('');
- repl.print(' - If you get stuck at the "...>" prompt, enter a semicolon (;) at the beginning of the line to force evaluation.');
- repl.print(' - If you get errors after every character you type, see http://github.com/bard/mozrepl/wikis/troubleshooting (short version: stop using Microsoft telnet, use netcat or putty instead)');
- repl.print('');
- repl.print('Current working context: ' + (repl._workContext instanceof Ci.nsIDOMWindow ?
- repl._workContext.document.location.href :
- repl._workContext));
- repl.print('Current input mode: ' + repl._env['inputMode']);
-
- repl.print('');
+ if(srvPref.getBoolPref('interactor.javascript.printWelcome')) {
+ repl.print('');
+ repl.print('Welcome to MozRepl.');
+ repl.print('');
+ repl.print(' - If you get stuck at the "...>" prompt, enter a semicolon (;) at the beginning of the line to force evaluation.');
+ repl.print(' - If you get errors after every character you type, see http://github.com/bard/mozrepl/wikis/troubleshooting (short version: stop using Microsoft telnet, use netcat or putty instead)');
+ repl.print('');
+ repl.print('Current working context: ' + (repl._workContext instanceof Ci.nsIDOMWindow ?
+ repl._workContext.document.location.href :
+ repl._workContext));
+ repl.print('Current input mode: ' + repl._env['inputMode']);
+
+ repl.print('');
+ }
if(repl._name != 'repl') {
repl.print('Hmmm, seems like other repl\'s are running in repl context.');
@@ -4,3 +4,4 @@ pref("extensions.mozrepl.port", 4242);
pref("extensions.mozrepl.loopbackOnly", true);
pref("extensions.mozrepl.version", "");
pref("extensions.mozrepl.defaultInteractor", "javascript");
+pref("extensions.mozrepl.interactor.javascript.printWelcome", true);

0 comments on commit 589fbc2

Please sign in to comment.