Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

func:MsgSortThreaded results in TypeError: win[cmdBody] is not a function #161

Open
duckdalbe opened this issue Nov 6, 2023 · 2 comments

Comments

@duckdalbe
Copy link

I'm trying to set two keybindings: one to show messages threaded, and one to show them unthreaded but grouped by sort. In previous versions of Thunderbird and tbkeys-lite (some while back), this worked with func:MsgSortThreaded and func:MsgGroupBySort, respectively.

With Thunderbird 115.2.3 and tbkeys-lite 2.2.4 on MacOS 14.1 ("Sonoma"), if I add a keybinding with each of those "simple functions", typing that key results in Thunderbird's default action for that key and this exception in the Error Console:

Uncaught TypeError: win[cmdBody] is not a function
    callback jar:file:///Users/x/Library/Thunderbird/Profiles/bbxmg1ib.default-release/extensions/tbkeys-lite@addons.thunderbird.net.xpi!/implementation.js:115
    _fireCallback jar:file:///Users/x/Library/Thunderbird/Profiles/bbxmg1ib.default-release/extensions/tbkeys-lite@addons.thunderbird.net.xpi!/modules/mousetrap.js:616
    _handleKey jar:file:///Users/x/Library/Thunderbird/Profiles/bbxmg1ib.default-release/extensions/tbkeys-lite@addons.thunderbird.net.xpi!/modules/mousetrap.js:677
    handleKey jar:file:///Users/x/Library/Thunderbird/Profiles/bbxmg1ib.default-release/extensions/tbkeys-lite@addons.thunderbird.net.xpi!/modules/mousetrap.js:1008
    _handleKeyEvent jar:file:///Users/x/Library/Thunderbird/Profiles/bbxmg1ib.default-release/extensions/tbkeys-lite@addons.thunderbird.net.xpi!/modules/mousetrap.js:737

These functions are listed at http://kb.mozillazine.org/Keyconfig_extension:_Thunderbird and are still available in comm-central, so I'm wondering what's wrong.

Anyone got a hint how to solve this?

@morat523035
Copy link

morat523035 commented Nov 7, 2023

Thunderbird 102:

window.MsgSortThreaded();
window.MsgGroupBySort();

Thunderbird 115:

window.gTabmail.currentAbout3Pane.sortController.sortThreaded();
window.gTabmail.currentAbout3Pane.sortController.groupBySort();

Or

window.goDoCommand('cmd_sort', {target:{value:'threaded'}});
window.goDoCommand('cmd_sort', {target:{value:'group'}});

Reference (see handleCommand)
http://searchfox.org/comm-esr115/source/mail/base/content/about3Pane.js

Reference (see cmd_sort)
http://searchfox.org/comm-esr115/source/mail/base/content/about3Pane.xhtml

You cannot run arbitrary javascript with tbkeys-lite. There is a tbkeys.xpi link on the GitHub releases page.

@duckdalbe
Copy link
Author

Thank you very much for the hints! I'll see if I'll switch to not-lite for this.

This issue could probably be closed (unless someone else has another suggestion?).

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

No branches or pull requests

2 participants