1

Is there a way to create a sidebar for the add-on? I saw how to add a panel at the bottom of the email using vbox (but I guess that's not the way to do it in the new architecture of Thunderbird add-ons). I want to add a sidebar panel on the right side. Changing to hbox does not work. Is this possible? This is in order to create an add-on that looks over the text of the email you compose and give insights in a sidebar.

Nathan B
  • 1,625
  • 1
  • 17
  • 15

1 Answers1

0

Not 100% sure (I have not tried), but for the newest versions of Thunderbird that only run Webextensions (78+), I believe you should look at the composeScripts API (see documentation). It should allow you to inject CSS stylesheets and JS scripts into the composing window. From there you should be able to edit the DOM, add your sidebar (basically a DIV floating to the right of the page I suppose) and the relevant actions.

Qeole
  • 8,284
  • 1
  • 24
  • 52
  • Can you actually change the Thunderbird's composing window with these functions? Any example somewhere for a demo add-on that does that? – Nathan B Sep 21 '20 at 12:11
  • Pretty sure we can, although I don't know any add-on that does it (but then I don't know all add-ons). Best pointers I have would be API doc, [this sample](https://github.com/thundernest/sample-extensions/blob/master/composeBody/background.js) using another API [`composeAction`](https://thunderbird-webextensions.readthedocs.io/en/latest/composeAction.html) (change compose window but through an “action” (a button to click)), and `composeScripts`-related tests [from comm-central](https://hg.mozilla.org/comm-central/file/tip/mail/components/extensions/test/browser/browser_ext_composeScripts.js). – Qeole Sep 21 '20 at 12:49