mirror of
https://github.com/gorhill/uMatrix.git
synced 2024-09-30 17:19:35 +13:00
this fixes https://github.com/gorhill/uBlock/issues/574
This commit is contained in:
parent
85220191c2
commit
7b651310b4
1 changed files with 21 additions and 5 deletions
|
@ -688,6 +688,11 @@ vAPI.tabs.open = function(details) {
|
||||||
}
|
}
|
||||||
|
|
||||||
this.select(tab);
|
this.select(tab);
|
||||||
|
|
||||||
|
// Update URL if fragment is different
|
||||||
|
if ( URI.equals(browser.currentURI) === false ) {
|
||||||
|
browser.loadURI(URI.asciiSpec);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1096,10 +1101,9 @@ var tabWatcher = (function() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var tabContainer = null;
|
// https://github.com/gorhill/uBlock/issues/574
|
||||||
if ( tabBrowser.tabContainer ) {
|
// To keep in mind: not all browser windows are tab containers.
|
||||||
tabContainer = tabBrowser.tabContainer;
|
var tabContainer = tabBrowser.tabContainer;
|
||||||
}
|
|
||||||
if ( tabContainer ) {
|
if ( tabContainer ) {
|
||||||
tabContainer.removeEventListener('TabOpen', onOpen);
|
tabContainer.removeEventListener('TabOpen', onOpen);
|
||||||
tabContainer.removeEventListener('TabShow', onShow);
|
tabContainer.removeEventListener('TabShow', onShow);
|
||||||
|
@ -1107,8 +1111,20 @@ var tabWatcher = (function() {
|
||||||
tabContainer.removeEventListener('TabSelect', onSelect);
|
tabContainer.removeEventListener('TabSelect', onSelect);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// https://github.com/gorhill/uBlock/issues/574
|
||||||
|
// To keep in mind: not all windows are tab containers,
|
||||||
|
// sometimes the window IS the tab.
|
||||||
|
var tabs;
|
||||||
|
if ( tabBrowser.tabs ) {
|
||||||
|
tabs = tabBrowser.tabs;
|
||||||
|
} else if ( tabBrowser.localName === 'browser' ) {
|
||||||
|
tabs = [tabBrowser];
|
||||||
|
} else {
|
||||||
|
tabs = [];
|
||||||
|
}
|
||||||
|
|
||||||
var browser, URI, tabId;
|
var browser, URI, tabId;
|
||||||
for ( var tab of tabBrowser.tabs ) {
|
for ( var tab of tabs ) {
|
||||||
browser = tabWatcher.browserFromTarget(tab);
|
browser = tabWatcher.browserFromTarget(tab);
|
||||||
if ( browser === null ) {
|
if ( browser === null ) {
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Reference in a new issue