Add APIs for opening attachments
Categories
(Thunderbird :: Add-Ons: Extensions API, enhancement)
Tracking
(thunderbird_esr102 wontfix)
Tracking | Status | |
---|---|---|
thunderbird_esr102 | --- | wontfix |
People
(Reporter: standard8, Assigned: standard8)
References
Details
Attachments
(3 files)
Bug 1522828 is for detach/deleting attachments, but I think it would be useful if add-ons could trigger displaying and downloading of a messages attachments as well.
For example, an extension could add a different attachments list display, or allow searching all messages for attachments, list those, and then make those available for opening/preview/etc.
I'm not quite sure if having something like bug 1606552, or access to the attachment data would negate the need for this though.
Comment 1•3 years ago
|
||
I have created an example add-on that does a preview for image and pdf attachments. It also allows to download them:
https://github.com/thundernest/sample-extensions/tree/master/attachmentPreview
Regarding the "download" part of this bug:
As shown, I consider this already possible.
Regarding the "preview" part of this bug:
Do you request to let Thunderbird render also previews for other content types than images? Does it do that already somewhere? My example add-on is manually doing the pdf preview. I believe this is how it should be.
Regarding the "opening" part of this bug:
I was not yet able to get browser.downloads.open()
working properly, so this will need some work. Ideas?
Assignee | ||
Comment 2•3 years ago
|
||
(In reply to John Bieling (:TbSync) from comment #1)
Regarding the "preview" part of this bug:
Do you request to let Thunderbird render also previews for other content types than images? Does it do that already somewhere? My example add-on is manually doing the pdf preview. I believe this is how it should be.
Ok, I'm getting confused by Conversation's options for previewing and opening. Which are slightly different. In the pdf context though - given that pdf is now integrated into Thunderbird - I think add-ons should be able to call an open function on the pdf attachment and that function will follow the user's content type (aka Files & Attachments) preferences. So if the user has to open in Thunderbird there, then it should do that.
Regarding the "opening" part of this bug:
I was not yet able to getbrowser.downloads.open()
working properly, so this will need some work. Ideas?
I think we might just have to have a dedicated API to open an attachment. The only other alternative would be to require the add-on to save it async before providing a button, but that would be a really bad experience.
It seems "preview" should be defined. To me, it is a very fast display (tooltip or panel on mouse hover) of about a page's worth of content (text/plain types, image thumbnail, formatted text like doc or pdf). It probably means using a platform specific implementation to do so for formatted types, as attempted in Bug 457546. It may or may not require draining the entire stream when reading the file, which would be "downloading" and opening - which isn't exactly a "preview".
Assignee | ||
Comment 4•3 years ago
|
||
Sorry, terminology is bad here, I'm going to drop the preview. John and I have been discussing on Matrix, and realised that "preview" here was in Conversation's terms of allowing to see something within Thunderbird, rather than preview as in a hover-over/thumbnail like thing.
Also removing "downloading" from the scope, since we already have that functionality.
Assignee | ||
Comment 5•1 year ago
|
||
Assignee | ||
Comment 6•1 year ago
|
||
Depends on D175008
Assignee | ||
Comment 7•1 year ago
|
||
Depends on D175009
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Assignee | ||
Updated•1 year ago
|
Updated•1 year ago
|
Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/7e13abe8e7ea
Move MsgOpenEMLFile to MailUtils.jsm for better access. r=john.bieling
https://hg.mozilla.org/comm-central/rev/14893c25d56e
Move AttachmentInfo to a module so that it can be more easily re-used from non-window contexts. r=john.bieling
https://hg.mozilla.org/comm-central/rev/decfbffda0b2
Add a message.openAttachment API for WebExtensions. r=john.bieling
Description
•