Downloads
Origin metadata
When a download completes, Firefox records where the file came from in platform-specific file metadata, so that file managers and the operating system can show the source of a file and apply the right security policy to it.
This happens in
DownloadIntegration.downloadDone(),
which calls into
DownloadPlatform.cpp.
It also covers Save Page As and Save Link As, since both create a
Download object.
Nothing is written for downloads started from a private window.
Platform |
What is written |
Where it shows up |
|---|---|---|
Windows |
|
Mark of the Web: the “unblock” checkbox in the file properties, and SmartScreen / Office protected view |
macOS |
|
Finder’s “Where from” field in Get Info |
Linux (GTK) |
GIO metadata attribute |
Readable with |
The Windows zone identifier is written directly rather than through
IAttachmentExecute::Save(), because the latter triggers operations that can
hang the application. Writing the stream directly is forward-compatible with
all current and future versions of Windows.
Tests live in common_test_Download.js.