From 9dbb00819f0a0f05206af815bf5ed9b527e6f775 Mon Sep 17 00:00:00 2001 From: Deathamns Date: Sun, 1 Mar 2015 21:38:51 +0100 Subject: [PATCH] Fennec: fix tab title --- platform/firefox/vapi-background.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/platform/firefox/vapi-background.js b/platform/firefox/vapi-background.js index bed630bfd..4c824544c 100644 --- a/platform/firefox/vapi-background.js +++ b/platform/firefox/vapi-background.js @@ -579,7 +579,7 @@ vAPI.tabs.get = function(tabId, callback) { } } - // for internal use + // For internal use if ( typeof callback !== 'function' ) { return tab; } @@ -595,9 +595,14 @@ vAPI.tabs.get = function(tabId, callback) { var browser = getBrowserForTab(tab); var tabBrowser = getTabBrowser(win); - var tabIndex = vAPI.fennec - ? tabBrowser.tabs.indexOf(tab) - : tabBrowser.browsers.indexOf(browser); + var tabIndex, tabTitle; + if ( vAPI.fennec ) { + tabIndex = tabBrowser.tabs.indexOf(tab); + tabTitle = browser.contentTitle; + } else { + tabIndex = tabBrowser.browsers.indexOf(browser); + tabTitle = tab.label; + } callback({ id: tabId, @@ -605,7 +610,7 @@ vAPI.tabs.get = function(tabId, callback) { windowId: windows.indexOf(win), active: tab === tabBrowser.selectedTab, url: browser.currentURI.asciiSpec, - title: tab.label + title: tabTitle }); };