mirror of
https://github.com/zen-browser/desktop.git
synced 2026-08-29 09:51:33 +00:00
chore: Refactor ZenSidebarManager and ZenUIManager to improve tab handling
This commit is contained in:
@@ -438,8 +438,7 @@ var gZenBrowserManagerSidebar = {
|
||||
let data = this.sidebarData;
|
||||
let panel = data.data[this.contextTab];
|
||||
let url = (browser == null) ? panel.url : browser.currentURI.spec;
|
||||
let tab = gBrowser.addTrustedTab(url);
|
||||
gBrowser.selectedTab = tab;
|
||||
gZenUIManager.openAndChangeToTab(url);
|
||||
this.close();
|
||||
},
|
||||
|
||||
|
||||
@@ -1,4 +1,12 @@
|
||||
|
||||
var gZenUIManager = {
|
||||
|
||||
openAndChangeToTab(url, options) {
|
||||
if (window.ownerGlobal.parent) {
|
||||
let tab = window.ownerGlobal.parent.gBrowser.addTrustedTab(url, options);
|
||||
window.ownerGlobal.parent.gBrowser.selectedTab = tab;
|
||||
return;
|
||||
}
|
||||
let tab = window.gBrowser.addTrustedTab(url, options);
|
||||
window.gBrowser.selectedTab = tab;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user