mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-07 03:12:33 +01:00
Merge pull request #811 from M-Reimer/master
Thunderbird: Fix closing extension tabs
This commit is contained in:
commit
557f6611b5
@ -818,7 +818,7 @@ vAPI.tabs.replace = function(tabId, url) {
|
|||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
vAPI.tabs._remove = (function() {
|
vAPI.tabs._remove = (function() {
|
||||||
if ( vAPI.fennec ) {
|
if ( vAPI.fennec || vAPI.thunderbird ) {
|
||||||
return function(tab, tabBrowser) {
|
return function(tab, tabBrowser) {
|
||||||
tabBrowser.closeTab(tab);
|
tabBrowser.closeTab(tab);
|
||||||
};
|
};
|
||||||
@ -972,6 +972,13 @@ var tabWatcher = (function() {
|
|||||||
if ( target.browser ) { // target is a tab
|
if ( target.browser ) { // target is a tab
|
||||||
target = target.browser;
|
target = target.browser;
|
||||||
}
|
}
|
||||||
|
} else if ( vAPI.thunderbird ) {
|
||||||
|
if ( target.mode ) { // target is object with tab info
|
||||||
|
var browserFunc = target.mode.getBrowser || target.mode.tabType.getBrowser;
|
||||||
|
if (browserFunc) {
|
||||||
|
return browserFunc.call(target.mode.tabType, target);
|
||||||
|
}
|
||||||
|
}
|
||||||
} else if ( target.linkedPanel ) { // target is a tab
|
} else if ( target.linkedPanel ) { // target is a tab
|
||||||
target = target.linkedBrowser;
|
target = target.linkedBrowser;
|
||||||
}
|
}
|
||||||
@ -1143,7 +1150,9 @@ var tabWatcher = (function() {
|
|||||||
// To keep in mind: not all windows are tab containers,
|
// To keep in mind: not all windows are tab containers,
|
||||||
// sometimes the window IS the tab.
|
// sometimes the window IS the tab.
|
||||||
var tabs;
|
var tabs;
|
||||||
if ( tabBrowser.tabs ) {
|
if ( vAPI.thunderbird ) {
|
||||||
|
tabs = tabBrowser.tabInfo;
|
||||||
|
} else if ( tabBrowser.tabs ) {
|
||||||
tabs = tabBrowser.tabs;
|
tabs = tabBrowser.tabs;
|
||||||
} else if ( tabBrowser.localName === 'browser' ) {
|
} else if ( tabBrowser.localName === 'browser' ) {
|
||||||
tabs = [tabBrowser];
|
tabs = [tabBrowser];
|
||||||
@ -1152,7 +1161,8 @@ var tabWatcher = (function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var browser, URI, tabId;
|
var browser, URI, tabId;
|
||||||
for ( var tab of tabs ) {
|
for ( var tabindex = tabs.length - 1; tabindex >= 0; tabindex-- ) {
|
||||||
|
var tab = tabs[tabindex];
|
||||||
browser = tabWatcher.browserFromTarget(tab);
|
browser = tabWatcher.browserFromTarget(tab);
|
||||||
if ( browser === null ) {
|
if ( browser === null ) {
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
Reference in New Issue
Block a user