mirror of https://github.com/gorhill/uBlock.git
Testing alternative tab ID for Fennec (issue #1001)
This commit is contained in:
parent
ac09dfadab
commit
05540108b7
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue