Closed Bug 2028832 Opened 22 days ago Closed 18 days ago

tabs.move of a single tab to a new window reverses tabs when the index is the same as the index of the other tab in the split

Categories

(WebExtensions :: Frontend, defect)

defect

Tracking

(firefox150 fixed, firefox151 fixed)

RESOLVED FIXED
151 Branch
Tracking Status
firefox150 --- fixed
firefox151 --- fixed

People

(Reporter: robwu, Assigned: robwu)

References

(Blocks 1 open bug)

Details

(Whiteboard: [addons-jira])

Attachments

(2 files)

The logic here assumes that the specified insertion point is in the same window, but does not check isSameWindow:
https://searchfox.org/firefox-main/rev/98bf4b92d3f5d7a9855281df4bf333210bcfbbc4/browser/components/extensions/parent/ext-tabs.js#1254-1257

Consequently, if an extensions had a split view consisting of tabId0 and tabId1, and called browser.tabs.move(tabId0, { windowId, index }) where windowId is for a different window, and index is coincidentally the same as the index of tabId1, then the moved split view will have its tabs reversed. That is unintentional.

This logic landed in 150, let's fix and uplift this.

I don't know why this bug was not automatically closed, but I can clearly see that the above patch has made it into Nightly 151.0a1 buildID 20260404090830, by observing the addition of the single-line change from the patch ( } else if (isSameWindow) { ) in chrome://browser/content/parent/ext-tabs.js

Moreover, when I check the main branch of the git repo, I see that eb6082f582dce843b61b43950f095d035f4b8123 is present.

The autoland commit above also shows that the commit was included in Nightly.

Status: ASSIGNED → RESOLVED
Closed: 18 days ago
Resolution: --- → FIXED
Target Milestone: --- → 151 Branch

firefox-beta Uplift Approval Request

  • User impact if declined/Reason for urgency: Fixes edge case in extension API for split views, added in bug 2016762.
  • Code covered by automated testing?: yes
  • Fix verified in Nightly?: yes
  • Needs manual QE testing?: no
  • Steps to reproduce for manual QE testing:
  • Risk associated with taking this patch: low
  • Explanation of risk level: Add a missing check where needed in the extension API, fully covered by automated tests, with no chance of any unexpected consequences.
  • String changes made/needed?: None
  • Is Android affected?: no
Attachment #9565683 - Flags: approval-mozilla-beta?
Attachment #9565683 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: