API to get sender information

I’ve build addon for Dark mode in message window (Darko) and I would like to add “Exclude” feature where user would right click and select “Don’t use Darko for this sender”.

So this way I could exclude some dark newsletters, like emails from Steam.

But I’m having problems with implementation.
First, I need to get the sender information (sender email?) when user clicks the context menu item. But even with the activeTab permission I’m not getting any useful info from the event handler.
Second, even if I get the sender info, I have to prevent my CSS from being injected into specified emails. So guess I would have to stop using:

browser.messageDisplayScripts.register({css: [{code: CSS_CODE}]});

(unless I could somehow use excludeMatches)
and replace it with javascript injection that would inject the CSS if the sender is not excluded. But here is again the problem that I don’t have the sender info.

Hi Juraj, the best place to ask about Thunderbird add-on development is at https://thunderbird.topicbox.com/groups/addons

I’m not quite sure how to answer your question, but I’m sure someone there will be able to help!

1 Like