New issue
Advanced search Search tips

Issue 733293 link

Starred by 4 users

Issue metadata

Status: WontFix
Owner: ----
Closed: Jun 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 2
Type: Bug



Sign in to add a comment

MIME associations do not work with Chromium (or Google Chrome)

Reported by tcall...@redhat.com, Jun 14 2017

Issue description

UserAgent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:53.0) Gecko/20100101 Firefox/53.0

Example URL:
http://cdimage.debian.org/debian-cd/current/amd64/bt-cd/

Steps to reproduce the problem:
1. Have a torrent client with a mime-type registered for application/x-bittorrent
2. Double-check by running: xdg-mime query default application/x-bittorrent (on my Fedora 26, this returns "deluge.desktop")
3. Triple-check by running xdg-open on the downloaded file:
xdg-open ~/Downloads/debian-8.8.0-amd64-CD-1.iso.torrent

What is the expected behavior?
Chromium launches the app from the .desktop file with the MimeType default for application/x-bittorrent via xdg-open.

What went wrong?
It just downloads the file instead. Google Chrome (same version) exhibits the same behavior.

Did this work before? N/A 

Chrome version: 59.0.3071.86  Channel: n/a
OS Version: Fedora 26
Flash Version: 

This was filed against Chromium 55 (and Fedora 25) back in January 2017. https://bugzilla.redhat.com/show_bug.cgi?id=1417374

I'm not sure how long it has been broken.
 

Comment 1 by mmenke@chromium.org, Jun 14 2017

Cc: benwells@chromium.org mea...@chromium.org
Components: UI>Browser>Navigation
[+benwells, +meacer]:  Looks like you guys own the ExternalProtocolHandler?  Not sure who else would be reasonable to direct this to - platform_util.h doesn't seem to have any owners.  Suppose it could also be related preliminary changes for PlzNavigate, so include navigation label as well.

Comment 2 by nasko@chromium.org, Jun 14 2017

Cc: asanka@chromium.org
PlzNavigate is not on 59 stable, has only been on Canary and Dev. Adding asanka@ for downloads behavior, in case there have been changes in that area that could be affecting the behavior.

Comment 3 by mmenke@chromium.org, Jun 14 2017

Indeed it's not, but the non-PlzNavigate path was significantly changed while preparing to get PlzNavigate out the door.

Comment 4 by nasko@chromium.org, Jun 14 2017

Labels: Needs-Bisect
Indeed it was changed. M55 is quite a while ago, so let's add Needs-Bisect and see if we can find when approximately it changed. I won't be able to do it in the next week or two, help is appreciated. 

Comment 5 by nasko@chromium.org, Jun 14 2017

Cc: clamy@chromium.org
Also, adding clamy@ explicitly.

Comment 6 by asanka@chromium.org, Jun 15 2017

Components: -Internals>Network UI>Browser>Downloads
Is this a regression?

The default action for any top level navigation that doesn't result in a response with a content type not understood by the renderer is to download it. It sounds like the behavior is WAI?

Comment 7 by mmenke@chromium.org, Jun 15 2017

Asanka:  This is about the case where the mime type is recognized by the underlying OS, in which case we should (I assume) be passing the file (URL?) to the registered OS-level handler for that mime type.

Comment 8 by asanka@chromium.org, Jun 15 2017

#7: Invoking the underlying OS to open a file happens after the file is downloaded and only if there's an explicit user request to open the file or if the user has configured the file type to be opened automatically. On Linux, files are opened via 'xdg-open' which should work correctly as long as the filename has a recognized extension.

In the general case, the browser doesn't -- and shouldn't -- invoke xdg-open on a response even if there's a registered handler for its MIME type. At least not without explicit configuration and user consent.

Or am I misunderstanding the issue? :-)
This isn't an external protocol handler thing, as that is about handling links with different schemes like magnet:. These are regular downloads with a mime type.

Did this ever work in the way requestd? I don't think Chrome ever opens downloaded files that have handlers for their mime types, it just downloads them. You can then double click the downloaded file if you want.
You're right.  I had been thinking this was the magic scheme case, not the launch-based-on-mime type case.  Which would make this a pure downloads issue, not a navigation one, and working as intended, unless trying to run the file from Chrome doesn't run xdg-open.
OP: Does Chrome behave the way you want if you set .torrent as a file type that always opens? You can do so by downloading a .torrent file, and picking "Always open files of this type" from the download shelf context menu.

If the resulting behavior is what you are looking for, then this is all WAI. I don't think Chromium should have a special case for .torrent file. Though this shouldn't prevent a distribution from pre-populating the "download.extensions_to_open" preference  so long as the security trade-off has been considered.

That said, I'll defer to the current downloads owners.

Comment 12 by ajha@chromium.org, Jun 15 2017

Labels: pre-stable-59.0.3071.86
It does behave as expected. I was under the impression that the default was for files to be opened. Thanks for the quick investigation and resolution.
Status: WontFix (was: Unconfirmed)
Thanks for the followup!  Going to go ahead and close this.
How about open Telegram (https://telegram.org/) mime association: 
tg://resolve?domain=spbmetro

xdg-open tg://resolve?domain=spbmetro - worked

Chromium 60.0.3112.113 (Developer Build) Ubuntu 17.04 (64-bit) didn't open that uri tg://resolve?domain=spbmetro

And some many more other association not working. Although everything worked before. Broken after upgrade to version 58.






 


Sign in to add a comment