diff --git a/browser/devtools/netmonitor/netmonitor-view.js b/browser/devtools/netmonitor/netmonitor-view.js index 00125227ca4b..b05776682577 100644 --- a/browser/devtools/netmonitor/netmonitor-view.js +++ b/browser/devtools/netmonitor/netmonitor-view.js @@ -337,7 +337,7 @@ RequestsMenuView.prototype = Heritage.extend(WidgetMethods, { this._registerLastRequestEnd(unixTime); // Append a network request item to this container. - let requestItem = this.push([menuView, aId], { + let requestItem = this.push([menuView, aId, ""], { attachment: { startedDeltaMillis: unixTime - this._firstRequestStartedMillis, startedMillis: unixTime, @@ -368,7 +368,7 @@ RequestsMenuView.prototype = Heritage.extend(WidgetMethods, { // Create the element node for the network request item. let menuView = this._createMenuView(selected.method, selected.url); - let newItem = this.push([menuView], { + let newItem = this.push([menuView,, ""], { attachment: Object.create(selected, { isCustom: { value: true } }) diff --git a/browser/devtools/shared/widgets/ViewHelpers.jsm b/browser/devtools/shared/widgets/ViewHelpers.jsm index 167f9e8710e9..b6b65d010a20 100644 --- a/browser/devtools/shared/widgets/ViewHelpers.jsm +++ b/browser/devtools/shared/widgets/ViewHelpers.jsm @@ -377,9 +377,13 @@ function Item(aOwnerView, aAttachment, aContents = []) { this.attachment = aAttachment; let [aLabel, aValue, aDescription] = aContents; + // Make sure the label and the value are always strings. this._label = aLabel + ""; this._value = aValue + ""; - this._description = (aDescription || "") + ""; + // Make sure the description is also a string, but only if it's available. + if (aDescription !== undefined) { + this._description = aDescription + ""; + } // Allow the insertion of prebuilt nodes, otherwise delegate the item view // creation to a widget. @@ -499,7 +503,7 @@ Item.prototype = { _label: "", _value: "", - _description: "", + _description: undefined, _prebuiltTarget: null, _target: null, finalize: null, @@ -663,9 +667,12 @@ this.WidgetMethods = { if (!selectedItem) { return false; } + + let { _label: label, _value: value, _description: desc } = selectedItem; this._widget.removeAttribute("notice"); - this._widget.setAttribute("label", selectedItem._label); - this._widget.setAttribute("tooltiptext", selectedItem._value); + this._widget.setAttribute("label", label); + this._widget.setAttribute("tooltiptext", desc !== undefined ? desc : value); + return true; },