Open Bug 1498714 Opened 6 years ago Updated 1 year ago

Remove multiselectedTabsCount and replace usages with selectedTabs.length


(Firefox :: Tabbed Browser, enhancement, P5)




Tracking Status
firefox64 --- affected


(Reporter: jaws, Unassigned, Mentored)


(Blocks 1 open bug)


gBrowser.multiselectedTabsCount returns the number of tabs that are selected if there are multiple tabs selected. It will only ever return 0, 2, 3, ...

gBrowser.selectedTabs.length returns the number of tabs that are selected. It will return always return numbers greater than or equal to 1.

We don't need two ways to get this value and the minor semantic difference can be confusing.
The problem is that selectedTabs sorts, which is expensive, and useless if you only care about the length.
There are also some callers that don't need order, e.g.
Maybe there should be a selectedTabs and a nondeterministicSelectedTabs, or selectedTabs and sortedSelectedTabs.
selectedTabs could be changed to a method that takes an {unsorted: true} argument for cases where order doesn't matter.
Severity: normal → S3

I am working on this.

You need to log in before you can comment on or make changes to this bug.