In Fennec is it possible to retrieve the profile path being used?

```
/data/data/org.mozilla.fennec_fdroid/files/mozilla/UNKNOWN.default
```

for instance.
May 25, 9:39pm

Yes. In Fennec (and Fennec F-Droid), you can retrieve the profile path from privileged JavaScript (e.g., an extension/add-on) using the ProfD directory service key:

javascript
const profilePath = Services.dirsvc.get("ProfD", Ci.nsIFile).path;

For Fennec F-Droid, this will return a path like:

text
/data/data/org.mozilla.fennec_fdroid/files/mozilla/XXXXXXXX.default

(where XXXXXXXX is a random profile identifier).


Notes:

  • This API is only available to privileged code (extensions/add-ons). Regular web content cannot access it for security reasons.
  • The same ProfD key works across Firefox platforms, including Fennec.
  • If you're developing an add-on, ensure you have the necessary permissions and use the Services module (import via ChromeUtils.import("resource://gre/modules/Services.jsm") in modern Firefox).
May 25, 9:40pm

This is a shared conversation and may include unverified content that doesn't reflect Mistral AI's views. Login to resume chatting.

Vibe can make mistakes. Check answers. Learn more