1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-07-08 12:57:57 +02:00

Testing alternative tab ID for Fennec (issue #1001)

This commit is contained in:
AlexVallat 2015-03-14 10:02:05 +00:00
parent ac09dfadab
commit 05540108b7

View File

@ -452,15 +452,9 @@ vAPI.tabs.getTabId = function(target) {
if ( vAPI.fennec ) {
if ( target.browser ) {
// target is a tab
return target.id;
}
for ( var win of this.getWindows() ) {
var tab = win.BrowserApp.getTabForBrowser(target);
if ( tab && tab.id !== undefined ) {
return tab.id;
}
return target.browser.loadContext.DOMWindowID;
}
return target.loadContext.DOMWindowID;
return -1;
}
@ -513,7 +507,8 @@ vAPI.tabs.getTabsForIds = function(tabIds, tabBrowser) {
if ( vAPI.fennec ) {
for ( tabId of tabIds ) {
var tab = tabBrowser.getTabForId(tabId);
var tab = tabBrowser.tabs.find(tab=>tab.browser.loadContext.DOMWindowID === Number(tabId));
if ( tab ) {
tabs.push(tab);
}