Skip to content

Fix print filter action broken in Thunderbird 128+#407

Open
RealRaven2000 with Copilot wants to merge 2 commits into
ESR140from
copilot/fix-printing-issue-thunderbird-152
Open

Fix print filter action broken in Thunderbird 128+#407
RealRaven2000 with Copilot wants to merge 2 commits into
ESR140from
copilot/fix-printing-issue-thunderbird-152

Conversation

Copilot AI commented Jul 7, 2026

Copy link
Copy Markdown

The "Print" filter action stopped working in Thunderbird 128+ (and broken in 152.0.1) due to window.ownerGlobal no longer providing access to PrintUtils, and the print.always_print_silent preference being removed in newer builds.

Changes

  • content/filtaquilla.js
    • Replace window.ownerGlobal with Services.wm.getMostRecentWindow("mail:3pane") to reliably obtain PrintUtils in modern Thunderbird; window.ownerGlobal kept as fallback:
      // Before
      var { PrintUtils } = window.ownerGlobal;
      
      // After
      let mainWin = Services.wm.getMostRecentWindow("mail:3pane") || window.ownerGlobal;
      var { PrintUtils } = mainWin || {};
    • Wrap print.always_print_silent pref read/write in try/catch — preference was removed in newer Thunderbird; an unguarded getBoolPref throws and aborts the entire print path. Restore is skipped if the pref was never readable (null sentinel).

Copilot AI changed the title [WIP] Fix printing issue with Thunderbird version 152.0.1 Fix print filter action broken in Thunderbird 128+ Jul 7, 2026
Copilot AI requested a review from RealRaven2000 July 7, 2026 09:26
@RealRaven2000

Copy link
Copy Markdown
Owner

I found a better workaround (diodn't see your activity here):

var { PrintUtils } = globalThis;

why this works:

Firefox removed js access to ownderGlobal. globalThis works both in ESR140 (strict_min_ver) and ESR152 as tested by me.
https://phabricator.services.mozilla.com/D297183

@RealRaven2000 RealRaven2000 marked this pull request as ready for review July 7, 2026 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No Printing with current Thunderbird-Version 152.0.1

2 participants