File picker for temporary add-ons does not handle directories well

NEW
Unassigned

Status

()

Firefox
Developer Tools: about:debugging
P2
normal
2 years ago
a year ago

People

(Reporter: kmag, Unassigned)

Tracking

(Depends on: 1 bug, Blocks: 2 bugs)

Firefox Tracking Flags

(Not tracked)

Details

+++ This bug was initially created as a clone of Bug #1283656 +++

(In reply to Robert Helmer [:rhelmer] from comment #2)
> (In reply to Kris Maglione [:kmag] from comment #1)
> > (In reply to Bill McCloskey (:billm) from comment #0)
> > > 2. Try to load the directory via "Install Temporary Add-on" in
> > > about:debugging. It doesn't let me pick a directory.
> > 
> > Yeah, this has annoyed me in the past too. You can load the directory, but
> > you have to choose an arbitrary file within it.
> > 
> > Can you file a separate bug, and CC Kumar and rhelmer?
> 
> This is actually a limitation in our platform-specific filepicker code, this
> is generally how picking a dir works in Firefox.
> 
> I'm not sure if all platforms allow you to pick a directory *or* a file in
> the same filepicker dialog, but agree it's worth filing a separate bug about.

It's something we should at least be able to fix on the platforms that support
it. If we can't, it might be worth having separate buttons to load temporary
files and temporary directories. The current behavior is pretty frustrating.
And it also makes the recent file list much more confusing when you have a
bunch of entries that all say just "manifest.json".
I'm pretty sure this is a dupe. Here are some candidates:

Bug 1269910 - "Load Temporary Add-on" should open a directory selector, not a file selector
    (RESOLVED DUPLICATE of Bug 1231129)

Bug 1231129 - about:debugging temporary add-on loading does not allow picking folders
    (RESOLVED WORKSFORME)

Bug 1266666 - 'Load Temporary Add-on' from unpacked/unzipped folder/directory requires to select file
    (RESOLVED DUPLICATE of Bug 1249315)

Bug 1249315 - Cannot select directory in "Select Add-on Directory or XPI File" dialog
    (RESOLVED DUPLICATE of Bug 1256246)

Bug 1256246 - Change prompt for selecting a directory when loading a temporary add-on
    (RESOLVED FIXED)
Depends on: 1283680
(In reply to Dan Callahan [:callahad] from comment #1)
> I'm pretty sure this is a dupe. Here are some candidates:
> 
> Bug 1269910 - "Load Temporary Add-on" should open a directory selector, not
> a file selector
>     (RESOLVED DUPLICATE of Bug 1231129)
> 
> Bug 1231129 - about:debugging temporary add-on loading does not allow
> picking folders
>     (RESOLVED WORKSFORME)
> 
> Bug 1266666 - 'Load Temporary Add-on' from unpacked/unzipped
> folder/directory requires to select file
>     (RESOLVED DUPLICATE of Bug 1249315)
> 
> Bug 1249315 - Cannot select directory in "Select Add-on Directory or XPI
> File" dialog
>     (RESOLVED DUPLICATE of Bug 1256246)
> 
> Bug 1256246 - Change prompt for selecting a directory when loading a
> temporary add-on
>     (RESOLVED FIXED)

It looks like the parent bug here is bug 1231129 which I filed, and I decided to just workaround the way I saw other parts of the tree doing it.

:kmag says all the platforms we care about support it should support this though, so let's see if we can really fix the underlying issue here in the platform in bug 1283680.
Yeah... I'm pretty sure five duplicates means we should fix this.
From discussions on IRC, this is very easy to fix on OS-X, where it's possible for the same file picker to select either a file or a directory.

On Windows and Linux, the best solutions we came up with were:

1) Make "Load Temporary Add-on" a menubutton, which opens with the options "Load from a directory" or "Load from a file", or,

2) Load the file-only file picker, but with filters for "*.xpi", "manifest.json", and "install.rdf" files, to make things clearer to the user. Changing the title text would probably be helpful too.
Triaging as P2 given the number of duplicates logged already.

Jan: we can either block this on the platform bug (bug 1283680), or implement the first proposal from :kmag

(In reply to Kris Maglione [:kmag] from comment #4)
> 1) Make "Load Temporary Add-on" a menubutton, which opens with the options
> "Load from a directory" or "Load from a file",
>
Flags: needinfo?(janx)
Priority: -- → P2
(In reply to Julian Descottes [:jdescottes] from comment #5)
> Jan: we can either block this on the platform bug (bug 1283680), or
> implement the first proposal from :kmag
> 
> (In reply to Kris Maglione [:kmag] from comment #4)
> > 1) Make "Load Temporary Add-on" a menubutton, which opens with the options
> > "Load from a directory" or "Load from a file",
> >

Given the platform bug's priority (P4) and the challenges with Windows and Linux, it might stay unresolved a long time, or even never get fixed, which means if we block on it we'll likely continue receiving many duplicate bugs about this problem.

About :kmag's proposals (thank you for them!) I think I prefer the second, because it requires fewer clicks from the user, and makes the "just select any file within the addon folder" situation a bit less weird.

Andy, what do you think?
Flags: needinfo?(janx) → needinfo?(amckay)
(In reply to Kris Maglione [:kmag] from comment #4)
> 2) Load the file-only file picker, but with filters for "*.xpi",
> "manifest.json", and "install.rdf" files, to make things clearer to the
> user. Changing the title text would probably be helpful too.

We already kind of did that in bug 1256246.
We just didn't changed the filter and let it accept any file, but we can do that if you think that would help. It will just not address the "recent files" list.

Also, I wouldn't invest a bunch of time to fix just OSX...
Agreed I wouldn't rely on the platform changes, they might take a long time.

I would actually prefer the choice of seperate buttons or a drop down to either load from a directory or from a file. Its pretty simple, easy to implement and easy to understand.
Flags: needinfo?(amckay)
Blocks: 1308879
You need to log in before you can comment on or make changes to this bug.