Need a formatFileSize API
Categories
(Thunderbird :: Add-Ons: Extensions API, enhancement)
Tracking
(Not tracked)
People
(Reporter: standard8, Assigned: TbSync)
Details
Attachments
(4 files)
nsIMessenger.formatFileSize
is used throughout Thunderbird to provide a consistent file size formatting for users.
Whilst WebExtensions could simulate it, it would seem better to expose it via an API so that it could be consistent.
We can't expose it only where we have APIs that return sizes, as a WebExtension may be displaying other sizes (e.g. pending attachments) that need to be formatted.
Updated•2 years ago
|
Assignee | ||
Comment 1•1 year ago
|
||
This API will be populated with utility methods useful for extension
developers. The main goal is to be consistent across add-ons and not
forcing add-ons to re-invent methods which already exist in Thunderbird.
If Thunderbrid decides to change the output of these functions, all
add-ons using them will automatically be adjusted as well.
Updated•1 year ago
|
Assignee | ||
Comment 2•1 year ago
|
||
Currently add-on developers try to do manual parsing, which is error
prone. It is true that they could load a third party library, but
exposing this makes it so much easier.
Depends on D204473
Assignee | ||
Updated•1 year ago
|
Pushed by daniel@thunderbird.net:
https://hg.mozilla.org/comm-central/rev/11c83faa7fe0
Add messengerUtilities API including a formatFileSize() method. r=mkmelin
https://hg.mozilla.org/comm-central/rev/5ce39dffae42
Add parseMailboxString() to messengerUtilities API. r=mkmelin
Assignee | ||
Comment 4•1 year ago
|
||
Assignee | ||
Comment 6•1 year ago
|
||
Assignee | ||
Updated•1 year ago
|
Pushed by daniel@thunderbird.net:
https://hg.mozilla.org/comm-central/rev/e0343a9db270
Follow-up to fix missing "optional" property in schema definition. r=mkmelin
Description
•