diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
commit | 40a355a42d4a9444dc753c04c6608dade2f06a23 (patch) | |
tree | 871fc667d2de662f171103ce5ec067014ef85e61 /browser/components/firefoxview/OpenTabs.sys.mjs | |
parent | Adding upstream version 124.0.1. (diff) | |
download | firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.tar.xz firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.zip |
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
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 }) { |