Support arbitrary filetypes in RemoteImages
Categories
(Firefox :: Messaging System, enhancement, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox102 | --- | fixed |
People
(Reporter: beth, Assigned: beth)
References
Details
Attachments
(1 file, 1 obsolete file)
It turns out we can create a Blob with type: application/octet-stream for any binary image type and the resulting URL from URL.createObjectURL will render correctly. The only issue is SVG, which must have a mimetype of image/svg+xml to render.
Assignee | ||
Comment 1•3 years ago
|
||
Assignee | ||
Comment 2•3 years ago
|
||
this could theoretically allow us to write .exe or .dmg files to disk, which is less than ideal. Instead lets support the image types listed on MDN.
Updated•3 years ago
|
Updated•3 years ago
|
Assignee | ||
Comment 3•3 years ago
|
||
This is a rewrite of large portions of RemoteImages. Previously, RemoteImages
just relied on the presence of correctly-names files on disk for its cache. Now
we are keeping proper track of what images we've saved via a JSONFile store.
This removes the need for embedding extensions in image IDs -- images
previously referenced as, e.g., "heart.png" can now be referenced without their
extension e.g., "heart". However, for backwards compatability, image IDs with
extensions will still be accepted, but the extension will be stripped off and
ignored.
Instead, we keep track of the mimetype (as reported by Remote Settings) in our
database, as well as the last time we loaded the image (instead of relying on
the last modified time from the filesystem, which is where we were caching that
information previously).
Additionally, some cleanup has been done to prevent image loading while cleanup
is ocurring and vice versa. All interactions that would modify the database go
through RemoteImages#withDb
, which executes a closure with the JSONFile
instance. This closure is a critical section and multiple closures are
prevented from executing at once.
Comment 5•3 years ago
|
||
Backed out as requested.
Backout link: https://hg.mozilla.org/integration/autoland/rev/6897ca5370917eb79cccd5aeab19de5f125d9a2c
Assignee | ||
Updated•3 years ago
|
Comment 7•3 years ago
|
||
bugherder |
Description
•