mirror of
https://github.com/zen-browser/components.git
synced 2025-07-07 21:59:59 +02:00
Refactor ZenTabUnloader to remove unused code and optimize tab handling
This commit is contained in:
parent
a615de5b6f
commit
5b2e0030ed
1 changed files with 2 additions and 8 deletions
|
@ -149,14 +149,12 @@
|
|||
"attention",
|
||||
]
|
||||
|
||||
allTabs = [];
|
||||
constructor() {
|
||||
if (!lazy.zenTabUnloaderEnabled) {
|
||||
return;
|
||||
}
|
||||
this.observer = new ZenTabsObserver();
|
||||
this.intervalUnloader = new ZenTabsIntervalUnloader(this);
|
||||
this.allTabs = gBrowser.tabs;
|
||||
this.observer.addTabsListener(this.onTabEvent.bind(this));
|
||||
}
|
||||
|
||||
|
@ -195,17 +193,13 @@
|
|||
}
|
||||
|
||||
handleTabClose(tab) {
|
||||
this.allTabs = this.allTabs.filter(t => t !== tab);
|
||||
// Nothing yet
|
||||
}
|
||||
|
||||
handleTabOpen(tab) {
|
||||
if (!lazy.zenTabUnloaderEnabled) {
|
||||
return;
|
||||
}
|
||||
if (this.allTabs.includes(tab)) {
|
||||
return;
|
||||
}
|
||||
this.allTabs.push(tab);
|
||||
this.updateTabActivity(tab);
|
||||
}
|
||||
|
||||
|
@ -224,7 +218,7 @@
|
|||
}
|
||||
|
||||
get tabs() {
|
||||
return this.allTabs;
|
||||
return gBrowser.tabs;
|
||||
}
|
||||
|
||||
canUnloadTab(tab, currentTimestamp, excludedUrls) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue