Proposal: MailExtensions API to allow UI overlays, but no script injection

John Bieling john.bieling at
Fri Oct 11 18:54:30 UTC 2019

Hi Phillip,

I would like to invalidate the raised security issues, as the API - as a
middle layer - has full control an can simply deny all the dangerous stuff:

- blacklist any onSomthing tags
- enforce chrome:// urls or local urls
- even enforce urls pointing to an existing target
- deny any JS

The only valid point is the possibility of add-ons breaking due to
changed UI being overlayed. But that is exactly the compromise I am
asking for. And after the XUL -> HTML transition is done, I do not think
we will see so many changes in the UI.

It is my strong believe, that it will not work to write generic UI APIs,
as they will never cover all possibilities. This will kill our creativity.


Am 11.10.2019 um 10:36 schrieb Philipp Kewisch:
> Hi John,
> I understand the desire to be able to overlay arbitrary UI elements, and I agree it is a powerful API to have.
> The issue with a such API is however specifically the stability. If we allow extensions to make arbitrary changes to the address book for example, we could never change anything in the address book without risking add-on compatibility issues.
> This is true now, where we still use xul, but also true when the UI is relatively stable. We would essentially have to make deprecation notices for every single patch in the UI, describing exactly what changed and how to migrate.
> Injecting DOM and then having access to that node will also allow developers to circumvent any protections and execute scripts. Just imagine the good ol' <img src="dfdghh" onerror="evil()"/>
> What does fit in well for WebExtensions is using UI that is easily secluded from the rest, and either declaratively defines how the UI manipulation should happen, so that the API can be changed if the UI changes, or is separate in an iframe that is managed by the API.
> Admittedly, Thunderbird has more places where adding UI makes sense, so we would have more APIs than Firefox, but anything that allows arbitrary access runs into the issues I described above.
> Philipp
>> On 10. Oct 2019, at 10:04 PM, John Bieling <john.bieling at> wrote:
>> In the last days I tried to understand the reasons behind the latest
>> announcements regarding legacy extensions. The reasons given so far are
>> - security issues
>> - stability issues (in terms of addons breaking so often, because stuff
>> changed in Thunderbird)
>> WebExtensions improve these things, but also restrict addon authors
>> creativity substantially. We would need to ask for every bit of UI
>> manipulation and we will depend on your good will. This is not a healthy
>> relationship. I would like to bring back that creativity without
>> compromising security.
>> Once the transition from XUL to HTML has been completed, I assume, the
>> Thunderbird UI will be stable again. So "overlaying" the Thunderbird UI
>> should not cause so many stability issues. The current legacy overlay
>> mode allows to inject scripts, which is the cause of the security issue.
>> The new Overlay API should ignore any scripts and be invoked from the
>> background.js like so:
>> browser.overlay.registerOverlay("chrome://messenger/content/addressbook/abNewCardDialog.xul",
>> "overlays/abNewCardWindow.xul");
>> and it should fire an onload event or something like that if any of the
>> registered overlays has been injected and we can than further manipulate
>> the DOM with wathever is allowed in WebExtension.
>> That would get rid of the need to write hundreds of different UI APIs.
>> Overlaying is not a bad thing, it is a very powerful and easy way to
>> extend a given UI.
>> Please give us back the power we deserve.
>> John
>> _______________________________________________
>> tb-planning mailing list
>> tb-planning at
> _______________________________________________
> tb-planning mailing list
> tb-planning at

More information about the tb-planning mailing list