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

Philipp Kewisch kewisch at thunderbird.net
Sat Oct 12 18:39:57 UTC 2019


Thanks for focusing the discussion, I much appreciate!

> On 12. Oct 2019, at 5:40 PM, John Bieling <john.bieling at gmx.de> wrote:
> 
> 
> Now before the thread derails, I would like to sum up. I think I invalidated all arguments raised so far:
> 
> 1. Overlay is a code monster
> 
> No its not, you can have a sleek implementation of about 500 lines and no other place in the code base needs to know about the overlay API. It is a self contained API. We will of course not use chrome.manifest anymore.
> 
> The overlay API just needs the window listener and an xml parser. There is actually not a big difference between XUL and HTML elements in the overlay file, just the namespace is different when creating the elements.
> 

I'll let Geoff make the argument. I think it was less about the LOC, but more about all the edge cases and things being expected to work.
> 
> 2. Overlay is a security issue
> 
> We simply disallow any JS and ignore any JS when parsing the overlay file. There is no security issue. After removing all the JS script stuff, the API will probably be even shorter than 500 lines.
> 
If no js is running, how would you for example insert a button to click on?

How would you prevent extensions from removing UI elements that belong to security features, e.g. validating certificates?

Removing all of the js script stuff reliably would likely require a library like DOMPurify, or a tag/attribute whitelist.

> 
> 3. Addons may break due to changes in the Thunderbird UI
> 
> That is true and it is the compromise I am asking for. But breaks due to UI changes are easy to fix, you mostly have to update an ID. And how often will the UI change, after all that XUL -> HTML transition is done?
> 
The UI may change at any time, even if subtly. What would the depreciation strategy look like for making UI changes? Would Thunderbird developers need to track and document each element they are changing?

How would you handle extensions that break Thunderbird UI due to their overlays?

This is the Firefox deprecation policy, I feel that if we are allowing access to all nodes we would have to follow a such thing for basically any UI change.

https://wiki.mozilla.org/WebExtensions/DeprecationPolicy

> 
> My knowledge about webext API is very very low, and I think I will need 10x more time than you to turn (for example) my OverlayManager into a proof-of-concept experiment. But I will go that extra mile, if you promise to consider it for core.
> 
> John
> 
> 
> 
> _______________________________________________
> tb-planning mailing list
> tb-planning at mozilla.org
> https://mail.mozilla.org/listinfo/tb-planning
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/tb-planning/attachments/20191012/b63a4a8e/attachment-0001.html>


More information about the tb-planning mailing list