mirror of
https://github.com/zen-browser/desktop.git
synced 2025-09-05 19:08:18 +00:00
Fixed unloading a tab on startup
This commit is contained in:
@@ -128,13 +128,20 @@
|
||||
class ZenTabUnloader extends ZenDOMOperatedFeature {
|
||||
static ACTIVITY_MODIFIERS = ['muted', 'soundplaying', 'label', 'attention'];
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
if (!lazy.zenTabUnloaderEnabled) {
|
||||
return;
|
||||
}
|
||||
this.intervalUnloader = new ZenTabsIntervalUnloader(this);
|
||||
}
|
||||
|
||||
init() {
|
||||
if (!lazy.zenTabUnloaderEnabled) {
|
||||
return;
|
||||
}
|
||||
this.insertIntoContextMenu();
|
||||
this.observer = new ZenTabsObserver();
|
||||
this.intervalUnloader = new ZenTabsIntervalUnloader(this);
|
||||
this.observer.addTabsListener(this.onTabEvent.bind(this));
|
||||
}
|
||||
|
||||
|
@@ -599,7 +599,11 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
||||
let showed = false;
|
||||
if (currentTab.pinned) {
|
||||
this.selectEmptyTab();
|
||||
gZenTabUnloader.explicitUnloadTabs([currentTab]);
|
||||
try {
|
||||
gZenTabUnloader.explicitUnloadTabs([currentTab]);
|
||||
} catch (e) {
|
||||
console.error('ZenWorkspaces: Error unloading tab', e);
|
||||
}
|
||||
showed = true;
|
||||
} else {
|
||||
const currentTabURL = currentTab.linkedBrowser?.currentURI?.spec;
|
||||
|
Reference in New Issue
Block a user