  
      delete this.hudReferences[aHUDId];
  
-@@ -2961,6 +2978,30 @@ HUD_SERVICE.prototype =
-   }
- };
- 
-+/**
-+ * Get the HudId from an element contained inside the HUD.
-+ * This is nasty nasty code, but rather than re-architect I'm just going to
-+ * document what I think is going on here. The refactoring should be done in a
-+ * separate bug.
-+ * We want a reference to the main HUD so we can add output to it, and rather
-+ * than passing a reference to that console around, we look it up via an id.
-+ * However we don't have that either so we walk up the tree to find the first
-+ * thing that has an id, and make the assumption that this is the correct one.
-+ * For reference, what we're looking for is vbox.hud-box.animated which is
-+ * created high up in makeHUDNodes(). I think.
-+ * @see JSTerm constructor where this code comes from
-+ * @see Bug 592469
-+ * @param nsIDOMNode aNode The node to search from
-+ * @return string The HUD ID
-+ */
-+function getHudIdFromNode(aNode) {
-+  let node = aNode;
-+  while (!node.hasAttribute("id")) {
-+    node = node.parentNode;
-+  }
-+  return node.getAttribute("id");
-+}
-+
- //////////////////////////////////////////////////////////////////////////
- // HeadsUpDisplay
- //////////////////////////////////////////////////////////////////////////
-@@ -3067,7 +3108,12 @@ function HeadsUpDisplay(aConfig)
+@@ -3067,7 +3074,12 @@ function HeadsUpDisplay(aConfig)
    // create the JSTerm input element
    try {
      this.createConsoleInput(this.contentWindow, this.consoleWrap, this.outputNode);

     bodyNode.appendChild(aBody);
 
     let repeatContainer = aDocument.createElementNS(XUL_NS, "hbox");
@@ -6725,3 +6821,243 @@ catch (ex) {
   // TODO: kill anything that may have started up
   // see bug 568665
 }

     this.outputNode = this.makeXULNode("richlistbox");
     this.outputNode.setAttribute("class", "hud-output-node");
     this.outputNode.setAttribute("flex", "1");
@@ -3501,27 +3577,11 @@ HeadsUpDisplay.prototype = {
     this.outputNode.setAttribute("style", "direction: ltr;");
     this.outputNode.setAttribute("seltype", "multiple");
 
