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

Support Thunderbird 115 #70

Open
Dtrieb opened this issue Jul 17, 2023 · 15 comments
Open

Support Thunderbird 115 #70

Dtrieb opened this issue Jul 17, 2023 · 15 comments

Comments

@Dtrieb
Copy link

Dtrieb commented Jul 17, 2023

Please add Support for Thunderbird 115

@EnigmaPatrick
Copy link

Looks like the basics work, but due to the new UI changes the alert_list on folders doesn't appear, so will need tweaking

@tjeb
Copy link
Owner

tjeb commented Jul 17, 2023

Well, it doesn't appear to be a one-evening fix; they also changed something in how scripts are loaded and scoped, so I think only part of the initialization is running (the Services object is now global, but that's not all; it looks like the loadSubscript() call has changed too, and I can't find any info on how or what).

@EnigmaPatrick
Copy link

@jobisoft
Copy link
Contributor

jobisoft commented Jul 24, 2023

After #71 was merged, you can now use browser.menus.create() in the background to build your localized menu structure in the tools_menu context and the folder_pane context:
https://webextension-api.thunderbird.net/en/stable/menus.html#contexttype

Feel free to ping me if you need additional pointers.

An example add-on which uses the menus API to build a complex menu structure is the profile switcher add-on:
https://addons.thunderbird.net/addon/profile-switcher/versions/?page=1#version-2.6

@tjeb
Copy link
Owner

tjeb commented Jul 31, 2023

@jobisoft Any idea how to get the equivalent of nsIMsgFolder.URI? I can fetch most data (side gripe: why is every basic call async now) but I can't seem to find an equivalent for the accounts incoming server name in the new API (which is part of the original folder URI).

Another nice thing I used to have it that when clicking on checkmark-type menu items I could simply add 'false' to the listener registration so that the checkmark could be toggled, but the menu would stay open. Is there a way to configure that in the new menu api?

@jobisoft
Copy link
Contributor

jobisoft commented Jul 31, 2023

side gripe: why is every basic call async now

That is actually an advantage and makes sure add-ons do not hang/kill the system. Just do not use .then() callbacks but async functions and your code does not look any different (except the async/await keywords).

@jobisoft
Copy link
Contributor

Another nice thing I used to have it that when clicking on checkmark-type menu items I could simply add 'false' to the listener registration so that the checkmark could be toggled, but the menu would stay open. Is there a way to configure that in the new menu api?

Never did that myself, will check.

@tjeb
Copy link
Owner

tjeb commented Jul 31, 2023

That is actually an advantage and makes sure add-ons do not hang/kill the system. Just do not use .then() callbacks but async functions and your code does not look any different (except the async/await keywords).

Yes that's what I've been doing, it's just that it feels weird for getter functions for essentially static data (and async functions with await every other line feel a bit weird too)

@jobisoft
Copy link
Contributor

Any idea how to get the equivalent of nsIMsgFolder.URI?

What do you need the URI for in WebExtension land? There we have accountId + path. In an experiment you can get the URI from a WebExtension accountId + path via:

let realFolder = context.extension.folderManager.get(accountId, path);

See this section (and the next one) for a bunch of useful conversion helpers:
https://webextension-api.thunderbird.net/en/stable/how-to/experiments.html#using-folder-and-message-types

@jobisoft
Copy link
Contributor

Yes that's what I've been doing, it's just that it feels weird for getter functions for essentially static data (and async functions with await every other line feel a bit weird too)

Is it static? What data are you pulling? Could it not have been changed in the meantime?

@tjeb
Copy link
Owner

tjeb commented Jul 31, 2023

What do you need the URI for in WebExtension land?

The folder URI is how alerts are matched to folders; changing to a different convention there would mean a non-reversible configuration update automation that i was hoping to circumvent for now.

@tjeb
Copy link
Owner

tjeb commented Jul 31, 2023

Is it static? What data are you pulling? Could it not have been changed in the meantime?

sorry, I mean 'static' as in globally available directly and always up-to-date, not as in 'does not change', never mind this thread of discussion :)

@jobisoft
Copy link
Contributor

If you still have an Experiment in your add-on, then you can of course add another Experiment to return the URI to the WebExtension to be able to compare it with stored data, but if you are almost a pure WebExtension and this matching part is the only remaining Experiment, I would try to migrate the stored data from URI to path.

@godzfire
Copy link

godzfire commented Nov 3, 2023

Can someone please take over this add on if the original author is unable to? This is mandatory for me and my multiple inboxes.

I'm stuck on 102 and refuse to update to 115 because of this.

@bf
Copy link

bf commented Jan 25, 2024

@jobisoft @tjeb how did you resolve this, as Components.classes["@mozilla.org/process/util;1"] is not available any more to launch external commands?

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

6 participants