Web-extension development, debugging and deployment

Hello,

I want to port one of my add-ons ScrollAnywhere to Thunderbird but I’m having hard time to debug the issues.

Also I’m not sure about some basic concepts:

  1. if I open e-mail in a new tab, will be my content script injected into that e-mail? If not, then how do I do that?

  2. how do I debug the content script in an e-mail? I can debug the background script, but I cannot find the debugging window for current tab (F12 doesn’t work).

  3. When is the Thunderbird 63 gonna be released? The Release calendar says: "Thunderbird tracks the ESR schedule column per Thunderbird release info. ". Does this mean that the this upgrade will come with next ESR 68 in July 2019?

Or I’m I here way too soon and the webextension API is nowhere near the finish line?
I can see the bug Get WebExtensions working in Thunderbird is fixed in 63, but the [meta] Add support for WebExtensions is not yet.

1 Like

Great question, looking for the same answer.

I guess I can answer my own question now :).
So 3 years ago was way too soon and the missing API was added only about an year ago:
https://webextension-api.thunderbird.net/en/91/messageDisplay.html

The good news is that majority of features works totally the same as in Firefox, so porting addons to Thunderbird was a piece of cake :).

The debugging is pretty awkward though, since web-ext doesn’t support Thunderbird, you have to reload your addon manually.

Regarding debugging message window, this can be done from the main debugging window (the one you see when you click “Inspect” button in Addons debugging page). It’s same as debugging Pop-up in Firefox, you need to click the upper right icon to switch script you want to debug. Pretty user-unfriendly and supper buggy.

When I was developing my Darko extension (which is for Thunderbird only), I was actually using Firefox and web-ext to develop it and then I just tested it in Thunderbird and released it.

I found the way to debug the content script, it’s different than debugging background script:

Debug content script: Inbox tab -> three lines icon -> Tools -> Developer Tools -> Developer Toolbox -> OK

What’s the procedure for debugging the popup?

However, as I’m testing it right now, I’m unable to debug messageDisplayScripts nor composeScripts scripts.
So as I’ve said before, it’s probably better to use Firefox if possible :slight_smile:, and then just test it in Thunderbird once it’s ready.

EDIT:
And bonus tip for developing popups - it’s much better to open the popup HTML in a separate tab, as normal page using browser.tabs.create. And if you place the code in the background script, it will run it and open it every time you reload the addon :slight_smile:.

@juraj.masiar In my thunderbird 91 I don’t see the icon you show in the last picture… I don’t see the option to choose…

I think it works only for Temporary loaded extensions. And probably only if there is multiple contexts to inspect.
It’s best to open the inspect window in a separate window (drag and drop the tab to its own instance) so that it’s always visible while you interact with the addon in the main window.