Closed Bug 1828966 Opened 8 months ago Closed 8 months ago

Pin to Toolbar context menu item is sometimes out of sync


(WebExtensions :: General, defect, P3)



(firefox114 fixed)

114 Branch
Tracking Status
firefox114 --- fixed


(Reporter: mconley, Assigned: willdurand)



(Whiteboard: [addons-jira])


(2 files)


  1. Install two WebExtensions that have browser actions. I'm using uBlock Origin and Firefox Relay.
  2. Pin one of the browser actions to the toolbar
  3. Shrink the browser window down so that both browser actions appear in the addons panel
  4. Open the addons panel
  5. Right-click on the browser action that was overflowed from the toolbar. The context menu should show "Pin to Toolbar" in the checked state.
  6. Right-click on the browser action that was already living in the panel and was never in the toolbar.


The context menu item for "Pin to Toolbar" for the second item should be in the unchecked state.


The menu item is in the checked state at first. A subsequent context click puts it in the unchecked state. I think there's some kind of race here.

The attached video shows the behaviour for both items in the panel - there seems to be a race for both of them.

Severity: -- → S4
Priority: -- → P3
Whiteboard: [addons-jira]

I could only reproduce on macOS but it is indeed a valid bug. I noticed
that moving the await code at the bottom of the function fixed it but
that didn't sound too great.

I decided to propose this patch instead, and I made sure that we
wouldn't hit a similar problem with the "disabled" state of the remove
button. Apparently, that still works as expected (on macOS).

I am not quite sure how to cover that with a test, though, because we
have test coverage for the attributes and the HTML markup is correctly
updated. For example, I could see the correct checked attribute in the
HTML (in the devtools) with the wrong context menu item state rendered,
sigh. This likely means the race is at a lower level (cocoa?).

Assignee: nobody → wdurand
Pushed by
Ensure Pin to Toolbar context menu item shows the correct state when opening the context menu. r=mconley
Closed: 8 months ago
Resolution: --- → FIXED
Target Milestone: --- → 114 Branch
You need to log in before you can comment on or make changes to this bug.