Closed Bug 1890352 Opened 1 year ago Closed 1 year ago

Add nsIDirectoryService system entry for the OS's Documents folder

Categories

(Core :: XPCOM, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
127 Branch
Tracking Status
firefox127 --- fixed

People

(Reporter: mconley, Assigned: mconley)

References

(Regressed 1 open bug)

Details

(Whiteboard: [fidefe-device-migration])

Attachments

(1 file)

There are certain things we'd like to offer to save in the user's Documents folder. I'd like to add an entry like this one, but for "Docs".

David Rubino dug out how we can ask the OS for this path.

On Windows, we can call SHGetKnownFolderPath(FOLDERID_Documents).
On macOS, we can call NSSearchPathForDirectoriesInDomains(NSDocumentDirectory)
On Linux, we can use the $XDG_DOCUMENTS_DIR variable in ~/.config/user-dirs.dirs, or if that doesn’t exist, use $HOME/Documents.

Whiteboard: [fidefe-device-migration]

It looks like we actually used to have some limited support for the documents folder, at least on Windows and Linux. I'm not entirely certain if macOS ever had it implemented. Anyhow, support for this folder was removed in bug 1449686 as part of a broader initiative to cleanup unused special directories from the directory service.

I guess we're at a point now where we have a use case and can add the documents folders back.

See Also: → 1449686
Assignee: nobody → mconley
Status: NEW → ASSIGNED
Pushed by mconley@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/1ebb69c4b2f0 Add OS Documents folder to nsIDirectoryService. r=xpcom-reviewers,nika
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 127 Branch
Regressions: 1948976
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: