Skip to content

First tab inconsistently sometimes does not display Current Folder Toolbar #625

@RealRaven2000

Description

@RealRaven2000

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_injectCurrentFolderBar is undefined. We can see this during displayNavigationToolbar() 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.registerWindow relative to window creation appears to be the root cause.

Proposed Workarounds / Next Steps

  1. Implement a runtime fallback: if QuickFolders_injectCurrentFolderBar is missing, explicitly inject the toolbar via a Utilities API into the correct contentWindow.
  2. Consider phasing out WindowListener in future versions to avoid timing and lifecycle issues, as suggested by John Bieling.
  3. Ensure displayNavigationToolbar always 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.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions