1
0
Fork 0
mirror of https://github.com/gorhill/uMatrix.git synced 2024-06-29 11:30:20 +12:00

Fennec: fix tab title

This commit is contained in:
Deathamns 2015-03-01 21:38:51 +01:00 committed by gorhill
parent 21c8bfa537
commit 42e84760dc

View file

@ -574,7 +574,7 @@ vAPI.tabs.get = function(tabId, callback) {
} }
} }
// for internal use // For internal use
if ( typeof callback !== 'function' ) { if ( typeof callback !== 'function' ) {
return tab; return tab;
} }
@ -590,9 +590,14 @@ vAPI.tabs.get = function(tabId, callback) {
var browser = getBrowserForTab(tab); var browser = getBrowserForTab(tab);
var tabBrowser = getTabBrowser(win); var tabBrowser = getTabBrowser(win);
var tabIndex = vAPI.fennec var tabIndex, tabTitle;
? tabBrowser.tabs.indexOf(tab) if ( vAPI.fennec ) {
: tabBrowser.browsers.indexOf(browser); tabIndex = tabBrowser.tabs.indexOf(tab);
tabTitle = browser.contentTitle;
} else {
tabIndex = tabBrowser.browsers.indexOf(browser);
tabTitle = tab.label;
}
callback({ callback({
id: tabId, id: tabId,
@ -600,7 +605,7 @@ vAPI.tabs.get = function(tabId, callback) {
windowId: windows.indexOf(win), windowId: windows.indexOf(win),
active: tab === tabBrowser.selectedTab, active: tab === tabBrowser.selectedTab,
url: browser.currentURI.asciiSpec, url: browser.currentURI.asciiSpec,
title: tab.label title: tabTitle
}); });
}; };