Bug 1903378 Comment 1 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

So the problem is that "disabled" state of the "Recently Closed Tabs" menu is set by `HistoryMenu.toggleRecentlyClosedTabs`, which is called by the `HistoryMenu._onPopupShowing` event listener, however that listener doesn't fire at all, because we just created the `HistoryMenu` object inside our own `popupshowing` [event listener](https://searchfox.org/mozilla-central/rev/b11735b86bb4d416c918e2b2413456561beff50c/browser/base/content/browser-menubar.js#153). Opening the menu bar a second time makes it work correctly, because the listener is already attached.

Is it really expected that this works with inline event handlers? i.e. do they always behave like `addEventListener` with `{capture: true}`?
So the problem is that the "disabled" state of the "Recently Closed Tabs" menu is set by `HistoryMenu.toggleRecentlyClosedTabs`, which is called by the `HistoryMenu._onPopupShowing` event listener, however that listener doesn't fire at all, because we just created the `HistoryMenu` object inside our own `popupshowing` [event listener](https://searchfox.org/mozilla-central/rev/b11735b86bb4d416c918e2b2413456561beff50c/browser/base/content/browser-menubar.js#153). Opening the menu bar a second time makes it work correctly, because the listener is already attached.

Is it really expected that this works with inline event handlers? i.e. do they always behave like `addEventListener` with `{capture: true}`?

Back to Bug 1903378 Comment 1