Closed Bug 1579031 Opened 1 year ago Closed 5 months ago

Implement browserAction.openPopup

Categories

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

enhancement

Tracking

(thunderbird_esr6870+ fixed, thunderbird70 fixed, thunderbird71 fixed)

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

People

(Reporter: Fallen, Assigned: Fallen)

Details

Attachments

(1 file)

The use case for this is to have multiple commands from the command API open the browser action popup, and depending on which key was pressed the popup behaves differently.

The only way I see this could be done is to use named commands instead of _execute_browser_action and then:

browser.commands.onCommand.addListener((name) => {
  lastCommand = name;
  browser.browserAction.openPopup();
});

Then the popup can use browser.runtime.getBackgroundPage().lastCommand. Looks like openPopup is not implemented for us, though it seems like a simple thing to do. Geoff, do you remember why it wasn't implemented?

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

I don't recall why this was never implemented. This seems to do the trick, although I found testing it complicated on account of the need to call openPopup from an event listener.
Flags: needinfo?(geoff)
Attachment #9094872 - Flags: review?(geoff) → review+

Pushed by mozilla@jorgk.com:
https://hg.mozilla.org/comm-central/rev/bf1f628f23f7
Implement browserAction.openPopup. r=darktrojan

Status: ASSIGNED → RESOLVED
Closed: 5 months ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 71.0
Comment on attachment 9094872 [details] [diff] [review]
Fix - v1

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

Refer to comment in bug 1545932 comment #6. Do you require beta exposure? This looks small and low-risk.
Attachment #9094872 - Flags: approval-comm-esr68?
Attachment #9094872 - Flags: approval-comm-esr68+
Attachment #9094872 - Flags: approval-comm-beta?
Attachment #9094872 - Flags: approval-comm-beta+

I feel this doesn't need a beta cycle since it just adds a feature.

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