mirror of
https://github.com/gorhill/uMatrix.git
synced 2024-09-29 08:41:11 +13:00
Fennec: fix tab title
This commit is contained in:
parent
21c8bfa537
commit
42e84760dc
1 changed files with 10 additions and 5 deletions
|
@ -574,7 +574,7 @@ vAPI.tabs.get = function(tabId, callback) {
|
|||
}
|
||||
}
|
||||
|
||||
// for internal use
|
||||
// For internal use
|
||||
if ( typeof callback !== 'function' ) {
|
||||
return tab;
|
||||
}
|
||||
|
@ -590,9 +590,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,
|
||||
|
@ -600,7 +605,7 @@ vAPI.tabs.get = function(tabId, callback) {
|
|||
windowId: windows.indexOf(win),
|
||||
active: tab === tabBrowser.selectedTab,
|
||||
url: browser.currentURI.asciiSpec,
|
||||
title: tab.label
|
||||
title: tabTitle
|
||||
});
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue