The following is a statement from a Thunderbird insider:
"Just to make sure that everything is clear now:
- We had up to now full power legacy addons, which have access to all core methods (Services.* and much more).
- legacy addons are to be deprecated
- the new addon type is called webextension
- We no longer can use core methods with webextensions, but only what is available as webextensions API (from firefox) and mailextensions API (from thunderbird)
- This of course removes a lot of functionality as we do not have web/mailextensions for all the nice things we could do with core methods
- For the time being we are allowed to create our own mailextension APIs as so called experiments to regain the missing features
- The implementation.js of such an experiment has again access to all core methods
- Over the next 2 years, we as addon authors and the core developers need to create as much mailextensions API as needed and merge them into core
- At some day, experiments will be disabled and access to core methods will be not allowed anymore - before this day comes we need to make sure to have all the functionality we once had with legacy addons available via mailextension APIs"
and
“That is why a few weeks ago it was announced that Thunderbird will also stop supporting legacy extensions with TB72.
That would mean, most of the addons will not work anymore, because we do not have all the webextensions API we need.
That is why we are allowed to use experiments. It must be clear, that simply stuffing your legacy code into an experiment will fix the problem
now, but that will stop working as soon as the transition is complete and experiments are disabled (they are already disabled in firefox).”
Or, simplified and in a nutshell: Put your legacy code in the implementation.js of a webextension experiment and it should work with Thunderbird 68.
If you like, you can use my example “Search Button Addon” as a starting point and put in your code: