1
0
Fork 0
mirror of https://github.com/gorhill/uMatrix.git synced 2024-06-29 19:40:27 +12:00
This commit is contained in:
gorhill 2015-08-06 14:46:37 -04:00
parent 85220191c2
commit 7b651310b4

View file

@ -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;