about:debugging "Load Temporary Add-on" file picker no longer opens in the folder the last add-on was loaded from
Categories
(DevTools :: about:debugging, defect)
Tracking
(firefox-esr115 fixed, firefox-esr153 fixed, firefox159 wontfix, firefox160 verified, firefox161 verified)
People
(Reporter: RyanVM, Assigned: edgar)
References
Details
(Keywords: regression)
Attachments
(4 external files)
Since Firefox 157, the file picker opened by "Load Temporary Add-on..." in about:debugging no longer opens in the folder the previous temporary add-on was loaded from; it opens in whatever folder the OS last used, such as the last download location. STR on Windows or Linux (not Flatpak/Snap): load an .xpi or .zip as a temporary add-on, save a file to a different folder, then click "Load Temporary Add-on..." again. Expected: the picker opens in the add-on's folder. Reported on Reddit after the bug 2077656 fix shipped in 159: https://www.reddit.com/r/firefox/comments/1xhaklt/file_upload_bug_still_affecting_aboutdebugging/
The likely cause: openTemporaryExtension() in devtools/client/aboutdebugging/src/modules/extensions-helper.js saves the selected file's own path to devtools.aboutdebugging.tmpExtDirPath for .xpi/.zip files (it only saves the parent folder for other files) and passes that path to fp.displayDirectory on the next open. Since bug 2068406, nsBaseFilePicker::SetDisplayDirectory silently ignores anything that is not a readable directory, except on macOS, Flatpak and Snap. Bug 2077656 relaxed that check only in the content process, but about:debugging opens its picker from the parent process.
Fix: save the folder rather than the file (file.isDirectory() ? file : file.parent) when writing the pref, and use the parent folder when reading an old pref value that points to a file.
Updated•1 month ago
|
Comment 2•1 month ago
|
||
| frontend-triage | ||
I checked the diagnosis in comment 0 against the code and it holds.
Cause. openTemporaryExtension() in extensions-helper.js only swaps in file.parent for files that are not .xpi or .zip. So after a packaged add-on is loaded, devtools.aboutdebugging.tmpExtDirPath holds the path of the .xpi itself. On the next open, that path is assigned to fp.displayDirectory (lines 56-66). about:debugging is a parent-process chrome page (no URI_MUST_LOAD_IN_CHILD in AboutDebuggingRegistration.sys.mjs), so it gets the native picker. Since bug 2068406, nsBaseFilePicker.cpp IsPotentiallyReadableDirectory() rejects anything that isn't a readable directory in the parent process, except on macOS and Flatpak/Snap. SetDisplayDirectory then quietly drops the path (line 301). The fix in bug 2077656 only covers the content process, so it doesn't reach this picker. Unpacked add-ons (picked through manifest.json) already store the folder, so they aren't affected.
Fix (only extensions-helper.js needs to change):
- On write, store the folder, not the file:
file.isDirectory() ? file.path : file.parent.path. Keep resolving the selectedfileto the caller as it is now. debug-targets.js is the only caller, and nothing else reads the pref. LocalModeMappings.sys.mjs already uses the same pattern. - On read, inside the existing try/catch, use
lastDir.parentwhen the stored path exists but isn't a directory. That repairs profiles that already store an .xpi path.
Test. Extend browser_aboutdebugging_addons_temporary_install_path.js:
- Install
resources/packaged-extension/packaged-extension.xpiand check that the pref stores its parent folder. - Push the pref to that .xpi path and check that the
MockFilePicker'sfp.displayDirectory.pathis the parent folder.
MockFilePicker doesn't apply the native directory check, so these tests check the value we pass, not the OS behaviour. Both would fail before the fix.
Suggested severity: S3. Developers loading packaged add-ons on Windows/Linux have to navigate back to the add-on's folder every time; nothing is broken beyond that, and loading the add-on from an unpacked folder avoids it.
If you'd like to provide feedback on this comment, please use the 👍 or 👎 reaction.
If you want to categorize your feedback you can add one of the following tags: ai-triage-{wrong-file, wrong-cause, hallucination, out-of-scope, not-a-bug, wrong-fix, shallow-fix, wrong-severity}.
Needinfo hackbot@mozilla.tld to have a patch generated for this bug, include any questions or directions as needed in your comment.
| Reporter | ||
Updated•1 month ago
|
| Assignee | ||
Comment 3•1 month ago
|
||
Updated•1 month ago
|
| Assignee | ||
Updated•1 month ago
|
| Reporter | ||
Updated•1 month ago
|
Comment 5•1 month ago
|
||
| bugherder | ||
Comment 6•1 month ago
|
||
The patch landed in nightly and beta is affected, along with ESR.
:edgar, please make an uplift decision for beta and ESR:
- For beta, nominate the patch for beta uplift approval if the fix should be included in this release, or set
status-firefox160towontfixif the fix can wait for the next release. - For ESR, nominate the patch for the appropriate ESR uplift approval if the fix should be included in ESR, or set the ESR status flag(s) to
wontfixif an uplift isn't needed. Each affected ESR release needs a decision.
Uplift requests can be submitted from Lando: D338013.
See Requesting an Uplift for documentation on how to request an uplift.
For more information, please visit BugBot documentation.
| Assignee | ||
Comment 7•1 month ago
|
||
I think this is worth to uplift to beta and ESR, WDYT?
Comment 8•1 month ago
|
||
(In reply to Edgar Chen [:edgar] from comment #7)
I think this is worth to uplift to beta and ESR, WDYT?
sounds fine, yes
Comment 9•29 days ago
|
||
THE next ESR RC go to build tomorrow, this would need beta/ESR uplift requests today to make it
Comment 10•29 days ago
|
||
firefox-beta Uplift Approval Request
- User impact if declined/Reason for urgency: Load Temporary Add-on" file picker in about:debugging doesn't open in the folder from which the last add-on was loaded.
- Code covered by automated testing?: yes
- Fix verified in Nightly?: yes
- Needs manual QE testing?: yes
- Steps to reproduce for manual QE testing: STR is in https://bugzilla.mozilla.org/show_bug.cgi?id=2086767#c0
- Risk associated with taking this patch: low
- Explanation of risk level: Loading non-*.zip or *.xpi behave the same, so the risk should be low.
- String changes made/needed?: None
- Is Android affected?: yes
| Assignee | ||
Comment 11•29 days ago
|
||
Original Revision: https://phabricator.services.mozilla.com/D338013
| Assignee | ||
Comment 12•29 days ago
|
||
Original Revision: https://phabricator.services.mozilla.com/D338013
Updated•29 days ago
|
Comment 13•29 days ago
|
||
firefox-esr115 Uplift Approval Request
- User impact if declined/Reason for urgency: Load Temporary Add-on" file picker in about:debugging doesn't open in the folder from which the last add-on was loaded.
- Code covered by automated testing?: yes
- Fix verified in Nightly?: yes
- Needs manual QE testing?: yes
- Steps to reproduce for manual QE testing: STR is in https://bugzilla.mozilla.org/show_bug.cgi?id=2086767#c0
- Risk associated with taking this patch: low
- Explanation of risk level: Loading non-*.zip or *.xpi behave the same, so the risk should be low.
- String changes made/needed?: None
- Is Android affected?: yes
Comment 14•29 days ago
|
||
firefox-esr153 Uplift Approval Request
- User impact if declined/Reason for urgency: Load Temporary Add-on" file picker in about:debugging doesn't open in the folder from which the last add-on was loaded.
- Code covered by automated testing?: yes
- Fix verified in Nightly?: yes
- Needs manual QE testing?: yes
- Steps to reproduce for manual QE testing: STR is in https://bugzilla.mozilla.org/show_bug.cgi?id=2086767#c0
- Risk associated with taking this patch: low
- Explanation of risk level: Loading non-*.zip or *.xpi behave the same, so the risk should be low.
- String changes made/needed?: None
- Is Android affected?: yes
| Assignee | ||
Comment 15•29 days ago
|
||
Original Revision: https://phabricator.services.mozilla.com/D338013
| Assignee | ||
Updated•29 days ago
|
Updated•29 days ago
|
Updated•29 days ago
|
Comment 16•29 days ago
|
||
| uplift | ||
Updated•29 days ago
|
Updated•29 days ago
|
Comment 17•29 days ago
|
||
| uplift | ||
Updated•29 days ago
|
Updated•29 days ago
|
Comment 18•29 days ago
|
||
| uplift | ||
Updated•29 days ago
|
Comment 19•28 days ago
|
||
Verified as Fixed. Tested on the latest Nightly (161.0a1/20261103080110) and Beta (160.0b5/20261102154636 from https://treeherder.mozilla.org/jobs?repo=mozilla-beta&revision=3f8ec0075b384e54bf9062a15b584265fe640745) under Windows 11 and Ubuntu 25.10.
The about:debugging "Load Temporary Add-on" file picker now properly opens in the folder the last add-on was loaded from, confirming the fix.
Builds for ESR153 and ESR115 are not currently available on Treeherder and I’ll verify them once they do become available.
Description
•