-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Labels
Description
Summary
On the first tab after starting Thunderbird, the Current Folder Toolbar sometimes does not appear, even though it exists in the DOM. Users see a missing toolbar, which breaks workflow until the add-on is reloaded or the tab is switched. This seems to be caused by the injection function QuickFolders_injectCurrentFolderBar not being registered in the first 3pane tab at runtime.
from qf-background.js:
// inject a separate script for current folder toolbar!
messenger.WindowListener.registerWindow("about:3pane", "chrome/content/scripts/qf-3pane.js");
messenger.WindowListener.registerWindow("about:message", "chrome/content/scripts/qf-3pane.js");the 3pane registration probably failed in this case intermittently (after Thunderbird starts up), as there is no QuickFolders_injectCurrentFolderBar and no toolbar is painted. the only workaround currently is to restart the Add-on or Thunderbird
Current Findings
- On the first 3pane tab,
gTabmail.currentTabInfo.chromeBrowser.contentWindow.QuickFolders_injectCurrentFolderBarisundefined. We can see this duringdisplayNavigationToolbar()which is called when we try to repaint the toolbar using "Display current folder tools" from the QF tools menu. - The toolbar element exists in the message pane document, but remains invisible because the injection function was never executed.
- Reloading the add-on or opening a new 3pane tab ensures proper injection and toolbar visibility.
- The timing of
messenger.WindowListener.registerWindowrelative to window creation appears to be the root cause.
Proposed Workarounds / Next Steps
- Implement a runtime fallback: if
QuickFolders_injectCurrentFolderBaris missing, explicitly inject the toolbar via a Utilities API into the correctcontentWindow. - Consider phasing out
WindowListenerin future versions to avoid timing and lifecycle issues, as suggested by John Bieling. - Ensure
displayNavigationToolbaralways resolves the correct document context (gTabmail.currentTabInfo.chromeBrowser.contentWindow) when updating the toolbar.
Notes
- The issue is primarily a timing / initialization problem, not a bug with toolbar creation logic itself.
- Related context: 3pane tabs,
about:3pane,about:message,currentFolderBar.
Reactions are currently unavailable