From 939fd3bd0ebe66564554c4bd92be6cae25cec217 Mon Sep 17 00:00:00 2001 From: Panos Astithas Date: Thu, 1 Nov 2012 15:34:41 +0200 Subject: [PATCH] Bug 802081 - listTabs returns empty tab titles after startup; r=rcampbell --- toolkit/devtools/debugger/server/dbg-browser-actors.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/toolkit/devtools/debugger/server/dbg-browser-actors.js b/toolkit/devtools/debugger/server/dbg-browser-actors.js index b50cf045807e..ffca057d95b3 100644 --- a/toolkit/devtools/debugger/server/dbg-browser-actors.js +++ b/toolkit/devtools/debugger/server/dbg-browser-actors.js @@ -296,9 +296,17 @@ BrowserTabActor.prototype = { dbg_assert(this.actorID, "tab should have an actorID."); + let title = this.browser.contentTitle; + // If contentTitle is empty (e.g. on a not-yet-restored tab), but there is a + // tabbrowser (i.e. desktop Firefox, but not Fennec), we can use the label + // as the title. + if (!title && this._tabbrowser) { + title = this._tabbrowser + ._getTabForContentWindow(this.browser.contentWindow).label; + } let response = { actor: this.actorID, - title: this.browser.contentTitle, + title: title, url: this.browser.currentURI.spec };