mirror of
https://github.com/gorhill/uBlock.git
synced 2024-10-06 09:37:12 +02:00
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 ( vAPI.fennec ) {
|
||||||
if ( target.browser ) {
|
if ( target.browser ) {
|
||||||
// target is a tab
|
// target is a tab
|
||||||
return target.id;
|
return target.browser.loadContext.DOMWindowID;
|
||||||
}
|
|
||||||
|
|
||||||
for ( var win of this.getWindows() ) {
|
|
||||||
var tab = win.BrowserApp.getTabForBrowser(target);
|
|
||||||
if ( tab && tab.id !== undefined ) {
|
|
||||||
return tab.id;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
return target.loadContext.DOMWindowID;
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -513,7 +507,8 @@ vAPI.tabs.getTabsForIds = function(tabIds, tabBrowser) {
|
|||||||
|
|
||||||
if ( vAPI.fennec ) {
|
if ( vAPI.fennec ) {
|
||||||
for ( tabId of tabIds ) {
|
for ( tabId of tabIds ) {
|
||||||
var tab = tabBrowser.getTabForId(tabId);
|
|
||||||
|
var tab = tabBrowser.tabs.find(tab=>tab.browser.loadContext.DOMWindowID === Number(tabId));
|
||||||
if ( tab ) {
|
if ( tab ) {
|
||||||
tabs.push(tab);
|
tabs.push(tab);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user