Bug 1747343 Comment 23 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

(In reply to Kelimutu [:kiki] from comment #20)
> (In reply to Shane Hughes [:aminomancer] from comment #19)
> > When downloading a file, we check for existing mime types and construct a new one if it's unrecognized. 
> 
> Does this mean that a new mime types will be automatically added to the Application list based on the setting that we set on comment #7 ? 
> 
> If that's the case, I think it'll also solve the confusion around adding a new content type. This might be subtle, but can be frustrating at times. I know we can choose the option to "always open similar files", but it's not in any way a direct way to add a new mime type. 

Thanks for sharing all the links, that's really helpful. I misspoke in my patch description. My bad. I should have said we check for an existing mimeInfo in the handler service, and if the type is not recognized we construct a new one. By construct I just mean we use the constructor that I modified. A new mimeInfo being constructed doesn't necessarily mean that a handler will be added via handlers.json.

A handler will only be added if the user uses the "Always open similar files" menuitem on a download element, or uses the "Do this automatically for files like this from now on" checkbox in the UCT dialog. So there is a way to add a handler, whether you enable this new pref or not. But certainly handlers don't need to be added if their action is the same as the global default action (which is set by this new pref).

So think about it like this, if I enable this new pref (What should Firefox do with other files?: Always ask) and I download a file of unrecognized type, then the UCT dialog is going to open. That dialog provides 1 of 2 layouts which contain all the possible actions. And it has a checkbox that lets me save my choice. So from there I can create a handler for future downloads.

The one thing I can't do is create a handler with action=alwaysAsk. Because "Do this automatically" means do the action I choose here automatically. And the action alwaysAsk would just result in opening another UCT dialog. So if we had that option in the UCT dialog of course it would just create a dialog loop. But it's fine not to put that option in the UCT dialog, because there's no need to create a handler for a mime type if the handler's action is just going to be the same as the default action. It won't result in any behavioral difference. The handler only matters insofar as it deviates from the global default.

However, I do think we could make an improvement for users who want saveToDisk to be the global default action, but want to be able to set some mime types to alwaysAsk. In that case, users have to...

1. Download a file of the type in question
2. Let the file save
3. Open downloads panel
4. Right-click the download element
5. Select "Always open similar files"
6. Let Firefox open the file (because this action doesn't only make a handler, it also opens the file — maybe that's not so good after all?)
7. Close whatever application it opened in
8. Go to about:preferences, find the Applications richlist
9. Find the new mime type
10. Set it to "Always ask"

I agree with jscher2000 on this point:
> The only way to select "Always Ask" is through the Settings page. It would be preferable if this could be done in a single step through the menu. Perhaps using a fly-out menu like the tri-state menu for the Bookmarks Toolbar.

I think that might be useful to have for the downloads panel. If the "Always open similar files" menuitem was replaced by a menu that contained menuitems for all the valid actions (this would have the same items as the menulist for the mime type in the richlist in about:preferences), then the user could immediately choose "Always ask" from this list without having to open the file (and of course, without having to make "Always ask" the global default).
(In reply to Kelimutu [:kiki] from comment #20)
> (In reply to Shane Hughes [:aminomancer] from comment #19)
> > When downloading a file, we check for existing mime types and construct a new one if it's unrecognized. 
> 
> Does this mean that a new mime types will be automatically added to the Application list based on the setting that we set on comment #7 ? 
> 
> If that's the case, I think it'll also solve the confusion around adding a new content type. This might be subtle, but can be frustrating at times. I know we can choose the option to "always open similar files", but it's not in any way a direct way to add a new mime type. 

Thanks for sharing all the links, that's really helpful. I misspoke in my patch description. My bad. I should have said we check for an existing mimeInfo in the handler service, and if the type is not recognized we construct a new one. By construct I just mean we use the constructor that I modified. A new mimeInfo being constructed doesn't necessarily mean that a handler will be added via handlers.json.

A handler will only be added if the user uses the "Always open similar files" menuitem on a download element, or uses the "Do this automatically for files like this from now on" checkbox in the UCT dialog (well maybe there are other cases I haven't encountered but these are at least the universal ones). So there is a way to add a handler, whether you enable this new pref or not. But certainly handlers don't need to be added if their action is the same as the global default action (which is set by this new pref).

So think about it like this, if I enable this new pref (What should Firefox do with other files?: Always ask) and I download a file of unrecognized type, then the UCT dialog is going to open. That dialog provides 1 of 2 layouts which contain all the possible actions. And it has a checkbox that lets me save my choice. So from there I can create a handler for future downloads.

The one thing I can't do is create a handler with action=alwaysAsk. Because "Do this automatically" means do the action I choose here automatically. And the action alwaysAsk would just result in opening another UCT dialog. So if we had that option in the UCT dialog of course it would just create a dialog loop. But it's fine not to put that option in the UCT dialog, because there's no need to create a handler for a mime type if the handler's action is just going to be the same as the default action. It won't result in any behavioral difference. The handler only matters insofar as it deviates from the global default.

However, I do think we could make an improvement for users who want saveToDisk to be the global default action, but want to be able to set some mime types to alwaysAsk. In that case, users have to...

1. Download a file of the type in question
2. Let the file save
3. Open downloads panel
4. Right-click the download element
5. Select "Always open similar files"
6. Let Firefox open the file (because this action doesn't only make a handler, it also opens the file — maybe that's not so good after all?)
7. Close whatever application it opened in
8. Go to about:preferences, find the Applications richlist
9. Find the new mime type
10. Set it to "Always ask"

I agree with jscher2000 on this point:
> The only way to select "Always Ask" is through the Settings page. It would be preferable if this could be done in a single step through the menu. Perhaps using a fly-out menu like the tri-state menu for the Bookmarks Toolbar.

I think that might be useful to have for the downloads panel. If the "Always open similar files" menuitem was replaced by a menu that contained menuitems for all the valid actions (this would have the same items as the menulist for the mime type in the richlist in about:preferences), then the user could immediately choose "Always ask" from this list without having to open the file (and of course, without having to make "Always ask" the global default).
(In reply to Kelimutu [:kiki] from comment #20)
> (In reply to Shane Hughes [:aminomancer] from comment #19)
> > When downloading a file, we check for existing mime types and construct a new one if it's unrecognized. 
> 
> Does this mean that a new mime types will be automatically added to the Application list based on the setting that we set on comment #7 ? 
> 
> If that's the case, I think it'll also solve the confusion around adding a new content type. This might be subtle, but can be frustrating at times. I know we can choose the option to "always open similar files", but it's not in any way a direct way to add a new mime type. 

Thanks for sharing all the links, that's really helpful. I misspoke in my patch description. My bad. I should have said we check for an existing mimeInfo in the handler service, and if the type is not recognized we construct a new one. By construct I just mean we use the constructor that I modified. A new mimeInfo being constructed doesn't necessarily mean that a handler will be added via handlers.json.

A handler will only be added if the user uses the "Always open similar files" menuitem on a download element, or uses the "Do this automatically for files like this from now on" checkbox in the UCT dialog (well maybe there are other cases I haven't encountered but these are at least the universal ones). So there is a way to add a handler, whether you enable this new pref or not. But certainly handlers don't need to be added if their action is the same as the global default action (which is set by this new pref).

So think about it like this, if I enable this new pref (What should Firefox do with other files?: Always ask) and I download a file of unrecognized type, then the UCT dialog is going to open. That dialog provides 1 of 2 layouts which contain all the possible actions. And it has a checkbox that lets me save my choice. So from there I can create a handler for future downloads.

The one thing I can't do is create a handler with action=alwaysAsk. Because "Do this automatically" means do the action I choose here automatically. And the action alwaysAsk would just result in opening another UCT dialog. So if we had that option in the UCT dialog of course it would just create a dialog loop. But it's fine not to put that option in the UCT dialog, because there's no need to create a handler for a mime type if the handler's action is just going to be the same as the default action. It won't result in any behavioral difference. The handler only matters insofar as it deviates from the global default. And that was the main rationale for this enhancement — before this, the global default was always saveToDisk.

However, I do think we could make an improvement for users who want saveToDisk to be the global default action, but want to be able to set some mime types to alwaysAsk. In that case, users have to...

1. Download a file of the type in question
2. Let the file save
3. Open downloads panel
4. Right-click the download element
5. Select "Always open similar files"
6. Let Firefox open the file (because this action doesn't only make a handler, it also opens the file — maybe that's not so good after all?)
7. Close whatever application it opened in
8. Go to about:preferences, find the Applications richlist
9. Find the new mime type
10. Set it to "Always ask"

I agree with jscher2000 on this point:
> The only way to select "Always Ask" is through the Settings page. It would be preferable if this could be done in a single step through the menu. Perhaps using a fly-out menu like the tri-state menu for the Bookmarks Toolbar.

I think that might be useful to have for the downloads panel. If the "Always open similar files" menuitem was replaced by a menu that contained menuitems for all the valid actions (this would have the same items as the menulist for the mime type in the richlist in about:preferences), then the user could immediately choose "Always ask" from this list without having to open the file (and of course, without having to make "Always ask" the global default).
(In reply to Kelimutu [:kiki] from comment #20)
> (In reply to Shane Hughes [:aminomancer] from comment #19)
> > When downloading a file, we check for existing mime types and construct a new one if it's unrecognized. 
> 
> Does this mean that a new mime types will be automatically added to the Application list based on the setting that we set on comment #7 ? 
> 
> If that's the case, I think it'll also solve the confusion around adding a new content type. This might be subtle, but can be frustrating at times. I know we can choose the option to "always open similar files", but it's not in any way a direct way to add a new mime type. 

Thanks for sharing all the links, that's really helpful. I misspoke in my patch description. My bad. I should have said we check for an existing mimeInfo in the handler service, and if the type is not recognized we construct a new one. By construct I just mean we use the constructor that I modified. A new mimeInfo being constructed doesn't necessarily mean that a handler will be added via handlers.json.

A handler will only be added if the user uses the "Always open similar files" menuitem on a download element, or uses the "Do this automatically for files like this from now on" checkbox in the UCT dialog (well maybe there are other cases I haven't encountered but these are at least the universal ones). So there is a way to add a handler, whether you enable this new pref or not. But certainly handlers don't need to be added if their action is the same as the global default action (which is set by this new pref).

So think about it like this, if I enable this new pref (What should Firefox do with other files?: Always ask) and I download a file of unrecognized type, then the UCT dialog is going to open. That dialog provides 1 of 2 layouts which contain all the possible actions. And it has a checkbox that lets me save my choice. So from there I can create a handler for future downloads.

The one thing I can't do is create a handler with action=alwaysAsk. Because "Do this automatically" means do the action I choose here automatically. And the action alwaysAsk would just result in opening another UCT dialog. So if we had that option in the UCT dialog of course it would just create a dialog loop. But it's fine not to put that option in the UCT dialog, because there's no need to create a handler for a mime type if the handler's action is just going to be the same as the default action. It won't result in any behavioral difference. The handler only matters insofar as it deviates from the global default. And that was the main rationale for this enhancement — before this, the global default was always saveToDisk.

However, I do think we could make an improvement for users who want saveToDisk to be the global default action, but want to be able to set some mime types to alwaysAsk. In that case, users have to...

1. Download a file of the type in question
1. Let the file save
1. Open downloads panel
1. Right-click the download element
1. Select "Always open similar files"
1. Let Firefox open the file (because this action doesn't only make a handler, it also opens the file — maybe that's not so good after all?)
1. Close whatever application it opened in
1. Go to about:preferences, find the Applications richlist
1. Find the new mime type
1. Set it to "Always ask"

I agree with jscher2000 on this point:
> The only way to select "Always Ask" is through the Settings page. It would be preferable if this could be done in a single step through the menu. Perhaps using a fly-out menu like the tri-state menu for the Bookmarks Toolbar.

I think that might be useful to have for the downloads panel. If the "Always open similar files" menuitem was replaced by a menu that contained menuitems for all the valid actions (this would have the same items as the menulist for the mime type in the richlist in about:preferences), then the user could immediately choose "Always ask" from this list without having to open the file (and of course, without having to make "Always ask" the global default).

Back to Bug 1747343 Comment 23