pdfs opened in the internal viewer via browser.messages.openAttachment don't have a name when downloaded
Categories
(Thunderbird :: Add-Ons: Extensions API, defect)
Tracking
(thunderbird_esr140 wontfix)
| Tracking | Status | |
|---|---|---|
| thunderbird_esr140 | --- | wontfix |
People
(Reporter: standard8, Assigned: mkmelin)
References
Details
Attachments
(2 files)
|
48 bytes,
text/x-phabricator-request
|
corey
:
approval-comm-beta-
|
Details | Review |
|
48 bytes,
text/x-phabricator-request
|
Details | Review |
STR (TB 140.0.1):
- In your add-on, have a line such as:
browser.messages.openAttachment(id, partName, tabId);
- Have Thunderbird's defaults to open pdfs in the internal viewer.
- Open a pdf attachment via the add-on so that it calls the
openAttachment, and opens in the internal viewer. - Click the save button
Actual Results
A save dialog appears with the document name as "document.pdf"
Expected Results
The save dialog should have the name of the attachment from the email.
If I open the attachment using Thunderbird's mail reader, then the save button works correctly. The imap://... url has an additional &filename=<name>.pdf in the URL, which I presume is what causes it work.
| Reporter | ||
Updated•9 months ago
|
| Assignee | ||
Comment 1•8 months ago
|
||
Propagate the filename param here? https://searchfox.org/comm-central/rev/f32ac8259c429ae1655e068a3f6bf65df5ee4361/mail/components/extensions/parent/ext-messages.js#993
| Assignee | ||
Comment 2•8 months ago
|
||
Updated•8 months ago
|
Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/0f00c8246bfc
Add filename to attachment url so that pdfs opened in the internal viewer via browser.messages.openAttachment have a name when downloaded. r=john.bieling
Drive-by comment: Does the fix
- url: getMsgPartUrl(msgHdr, partName),
+ url:
+ getMsgPartUrl(msgHdr, partName) +
+ `&filename=${attachmentPart.name}`,
work for "exotic" filenames? Like filenames with spaces, non-ASCII, etc.?
| Assignee | ||
Comment 5•5 months ago
|
||
Good catch, that does indeed need to be encoded!
| Assignee | ||
Comment 6•5 months ago
|
||
Updated•5 months ago
|
| Assignee | ||
Updated•5 months ago
|
Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/3fe1f53a722d
encode filenames for browser.messages.openAttachment. r=john.bieling
| Assignee | ||
Updated•5 months ago
|
| Assignee | ||
Comment 8•5 months ago
|
||
Comment on attachment 9510007 [details]
Bug 1978213 - Add filename to attachment url so that pdfs opened in the internal viewer via browser.messages.openAttachment have a name when downloaded. r=john.bieling
Uplift Approval Request
- Please state case for uplift consideration and ensure bug severity is set: Polish
(both patches) - User impact if declined: Real filename can't be used
- Is this code covered by automated tests?: No
- Has the fix been verified in Daily?: Yes
- Has the fix been verified in Beta?: No
- Needs manual test from QA?: No
- If yes, steps to reproduce:
- List of other uplifts needed: None
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): It's a small confined change.
- Does the fix cause any migrations to be skipped?: No
- String changes made/needed:
Comment 9•4 months ago
•
|
||
Comment on attachment 9510007 [details]
Bug 1978213 - Add filename to attachment url so that pdfs opened in the internal viewer via browser.messages.openAttachment have a name when downloaded. r=john.bieling
[Triage Comment]
I don't think this qualifies for uplift unfortunately. Please demonstrate that it is a high-impact issue that qualifies according to these guidelines: https://developer.thunderbird.net/releases/uplifting-fixes
Description
•