From 797c2a1ad9f3f227646127e14e267a3646c1f4d7 Mon Sep 17 00:00:00 2001 From: Berker Peksag Date: Mon, 9 Jan 2012 15:38:48 +0000 Subject: [PATCH] Bug 683510 - GCLI needs a 'console' command; r=msucan --- browser/devtools/webconsole/GcliCommands.jsm | 12 ++++++++++++ .../chrome/browser/devtools/gclicommands.properties | 5 +++++ 2 files changed, 17 insertions(+) diff --git a/browser/devtools/webconsole/GcliCommands.jsm b/browser/devtools/webconsole/GcliCommands.jsm index 227b0db5d26a..a9bc82779de2 100644 --- a/browser/devtools/webconsole/GcliCommands.jsm +++ b/browser/devtools/webconsole/GcliCommands.jsm @@ -84,6 +84,18 @@ gcli.addCommand({ }); +/** + * 'console close' command + */ +gcli.addCommand({ + name: "console close", + description: gcli.lookup("consolecloseDesc"), + exec: function(args, context) { + let tab = HUDService.getHudReferenceById(context.environment.hudId).tab; + HUDService.deactivateHUDForContext(tab); + } +}); + /** * 'inspect' command */ diff --git a/browser/locales/en-US/chrome/browser/devtools/gclicommands.properties b/browser/locales/en-US/chrome/browser/devtools/gclicommands.properties index 65bdb0dfb5f5..ce59a4d8bdd4 100644 --- a/browser/locales/en-US/chrome/browser/devtools/gclicommands.properties +++ b/browser/locales/en-US/chrome/browser/devtools/gclicommands.properties @@ -55,3 +55,8 @@ inspectNodeDesc=CSS selector # parameter to the 'inspect' command, displayed when the user asks for help # on what it does. inspectNodeManual=A CSS selector for use with Document.querySelector which identifies a single element + +# LOCALIZATION NOTE (consolecloseDesc) A very short description of the +# 'console close' command. This string is designed to be shown in a menu +# alongside the command name, which is why it should be as short as possible. +consolecloseDesc=Close the console