diff options
Diffstat (limited to 'browser/components/firefoxview/OpenTabs.sys.mjs')
-rw-r--r-- | browser/components/firefoxview/OpenTabs.sys.mjs | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/browser/components/firefoxview/OpenTabs.sys.mjs b/browser/components/firefoxview/OpenTabs.sys.mjs index ac247f5e8f..0771bf9e65 100644 --- a/browser/components/firefoxview/OpenTabs.sys.mjs +++ b/browser/components/firefoxview/OpenTabs.sys.mjs @@ -36,6 +36,8 @@ const TAB_RECENCY_CHANGE_EVENTS = Object.freeze([ "TabAttrModified", "TabClose", "TabOpen", + "TabPinned", + "TabUnpinned", "TabSelect", "TabAttrModified", ]); @@ -329,17 +331,21 @@ class OpenTabsTarget extends EventTarget { return []; } + /** + * Get an aggregated list of tabs from all the same-privateness browser windows. + * + * @returns {MozTabbrowserTab[]} + */ + getAllTabs() { + return this.currentWindows.flatMap(win => this.getTabsForWindow(win)); + } + /* * @returns {Array<Tab>} * A by-recency-sorted, aggregated list of tabs from all the same-privateness browser windows. */ getRecentTabs() { - const tabs = []; - for (let win of this.currentWindows) { - tabs.push(...this.getTabsForWindow(win)); - } - tabs.sort(lastSeenActiveSort); - return tabs; + return this.getAllTabs().sort(lastSeenActiveSort); } handleEvent({ detail, target, type }) { |