Closed Bug 1545932 Opened 1 year ago Closed 5 months ago

Opening a browserAction button should return focus to the previous location when closed


(Thunderbird :: Add-Ons: Extensions API, defect, P3)



(thunderbird_esr6870+ fixed, thunderbird70 fixed, thunderbird71 fixed)

Thunderbird 71.0
Tracking Status
thunderbird_esr68 70+ fixed
thunderbird70 --- fixed
thunderbird71 --- fixed


(Reporter: Fallen, Assigned: Fallen)


(Blocks 1 open bug)



(1 file)


  • Create a WX add-on with a browser action and a keyboard shortcut for it
  • Navigate to message pane
  • Press keyboard shortcut (clicking also works), do things in the browser action that will finally close the popup window


  • The focus returns to the message pane tree, arrow keys will allow moving to the next message


  • The focus goes to the window object, not the tree it was previously at

This is essential for add-ons that aim to improve keyboard navigation and make actions for selected items, such as my quickmove extension. Here is a wx version of the add-on you can use for testing:

I'm thinking about where to best implement this. My initial thought was saving document.activeElement when the popup is opened, and then returning to that when closed. Any thoughts darktrojan?

Flags: needinfo?(geoff)
Attached patch Fix - v1 β€” β€” Splinter Review
Assignee: nobody → philipp
Attachment #9094863 - Flags: review?(geoff)
Flags: needinfo?(geoff)
Priority: -- → P3
Comment on attachment 9094863 [details] [diff] [review]
Fix - v1

Seems reasonable.
Attachment #9094863 - Flags: review?(geoff) → review+
Target Milestone: --- → Thunderbird 71.0

Pushed by
Return focus to previous element when closing browser action. r=darktrojan

Closed: 5 months ago
Keywords: checkin-needed
Resolution: --- → FIXED
Comment on attachment 9094863 [details] [diff] [review]
Fix - v1

I'd like to see this in release if possible, it will help me get rid of hacks for an add-on I'm working on.
Attachment #9094863 - Flags: approval-comm-esr68?
Attachment #9094863 - Flags: approval-comm-beta?
Comment on attachment 9094863 [details] [diff] [review]
Fix - v1

Too bad we didn't include it in TB 70 beta 3 which shipped two days ago. I guess there's no harm done sticking it into the next available ESR release or would you like some beta exposure first. Seems like a small low-risk patch.
Attachment #9094863 - Flags: approval-comm-esr68?
Attachment #9094863 - Flags: approval-comm-esr68+
Attachment #9094863 - Flags: approval-comm-beta?
Attachment #9094863 - Flags: approval-comm-beta+

To me this seems low risk and I don't think it needs a beta cycle, I trust your judgement though.

TB 70 beta 4:

We decided to do beta 4, so in it went. Will go into 68.2 after that.

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