-
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get rid of legacy components #9
Comments
Hi John, I brought back this addon for modern Thunderbird mainly for my personal use (instead of being an active maintainer), so I wouldn't put much effort on refactoring it once it works on current version. But I can provide help if someone wants to work on this, so PRs are welcome and I will review in time! However, I am trying to build another addon to automatically detect avatar for each message, and add avatar div to messages in thread pane card view. So, although I wouldn't start getting rid of legacy components on this project, I would opt in the modern way if there is a good solution to implement my addon in it. What I have not found in modern addon development is the way to inject script and CSS to However in Thunderbird:
So, I think there should be (experiment) APIs for content scripts / CSS of the whole For reference: Compact Header's solution are not good enough compared to WindowListener API / Content Script in some points:
Regards, |
We probably should move this discussion to a different space :-) So foremost you are right, that we still have areas not accessible to WebExtension APIs, and it will take more time to get there. However, the Windowlistener API is not the only way to patch the core UI of Thunderbird, in fact it is a very discouraged way, because it keeps you stuck in an old pattern of how to code. Specifically locales, prefs and options. You do not need the Windowlistener API just to be able to react to windows/tabs being opened. The Windowlistener API is just a very complex wrapper around the core But before you use
or
|
Take a look at this PR: dillenger/compact-headers#2. When starting Thunderbird, it shows the welcome page, in which case
I'd like to try drafting a new experiment API named |
True. The add-on I copied this example from is reacting to a |
The term "content script" is already in use and reserved for scripts loaded into content (web-pages) - and supported by Thunderbird. I think you want to modify the thread pane or the message header area? Both are chrome and not content (AFAIK). Ideal would be a mockup of where your avatar would end up, so I have a better understanding of what you are trying to do. |
I have already implemented the avatar div in thread card, using Avatar div is on the left of each thread card, can be toggled by
Indeed all related browser are chrome ( |
Nice. ChromeScripts would be a better matching name, yes. But I am not so sure about the API itself. It will never be able to land. I do not know if you just want to work on this API to have something until someone else implements this in core, or if you aim at contributing. An API that can land would be something which is related more to a specific use case, here the cards view. Something I have thought about for the message header area is a template definition with add-on callbacks (WebExtension events, to provide and cache the data for the custom elements in the template). This would work for the cards view as well, I think. What I have not solved yet is a robust way to let multiple add-ons change the template. Maybe you have ideas. The other concept of course is to turn the message header area and the threadpane into real content iframes, allowing standard content scripts to modify them. But I fear that this will cause trouble down the road. |
I prefer custom script injection way like For compatibility, take my avatar div element as example: To not change messenger's original HTML structure, the avatar div is inserted this way: <tr is="thread-card">
<div class="thread-card-avatar-container"> <- New avatar container div! used more CSS code to make it looks good
<div class="recipient-avatar"></div>
</div>
<div class="thread-card-container"> <- Original container div
<div class="thread-card-row"></div>
<div class="thread-card-row"></div>
</div>
</tr> But a simpler and more intuitive structure would be to use nested flex elements: <tr is="thread-card">
<div> <- New parent div, row flex direction
<div class="recipient-avatar"></div>
<div class="thread-card-container"> <- Original container div, column flex direction
<div class="thread-card-row"></div>
<div class="thread-card-row"></div>
</div>
</div>
</tr> However, the newly introduced parent div just breaks the structure of |
Hi, saw your effort to bring this back to life. Thanks!
The add-on you started to work on uses ancient technology and will break again soon. There are a few steps you could do to get rid of them:
We have many community channels which you can use if you seek further help:
https://developer.thunderbird.net/add-ons/community
Note: There will be no updated version of the WindowListener API for the next ESR. This was intended as a hot fix for the transition to TB78 and became unmaintainable by now. Also, using it does not allow developers to actually develop real APIs, which could be merged into Thunderbird.
Looking forward to seeing you around,
John
The text was updated successfully, but these errors were encountered: