Wrong browser is launched when double clicking a link desktop entry (.desktop) file

Bug #591693 reported by Jakob Unterwurzacher
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Nautilus
Invalid
Medium
nautilus (Ubuntu)
Triaged
Low
Unassigned

Bug Description

Binary package hint: nautilus

Note:
This is not bug 17081. My association for .html files is a text editor, and associations for .desktop files cannot be changed.

Bug:
I double-click the Google.desktop file (http://launchpadlibrarian.net/50005972/Google.desktop) and Firefox opens, while my default browser is Google Chrome.
This desktop file has been created by pulling a link to the desktop.

ProblemType: Bug
DistroRelease: Ubuntu 10.04
Package: nautilus 1:2.30.1-0ubuntu1
ProcVersionSignature: Ubuntu 2.6.32-22.33-generic 2.6.32.11+drm33.2
Uname: Linux 2.6.32-22-generic i686
NonfreeKernelModules: nvidia
Architecture: i386
Date: Wed Jun 9 13:33:54 2010
ProcEnviron:
 LANGUAGE=es_ES:es:en_GB:en
 PATH=(custom, user)
 LANG=es_ES.UTF-8
 SHELL=/bin/bash
SourcePackage: nautilus

Revision history for this message
Jakob Unterwurzacher (jakobunt) wrote :
description: updated
Changed in nautilus:
status: Unknown → New
Revision history for this message
Pedro Villavicencio (pedro) wrote :

Thank you for sent it upstream.

Changed in nautilus (Ubuntu):
status: New → Triaged
importance: Undecided → Low
Changed in nautilus:
importance: Unknown → Medium
Revision history for this message
Doug Morse (dm-dougmorse) wrote :

Hi, I seem to have a very similar problem: default browser of Firefox seems to work fine across the board EXCEPT for when I double-click on a .desktop file acting as a URL (i.e., like with Jakob, created by dragging a link to the desktop). In my case, however, Opera is the correct browser. At one point in time, I did have Opera set as the default browser, but that was about 6 months ago. This is the first time I've created desktop URL links, however, and hence also the first time I'm experiencing this problem.

Revision history for this message
Doug Morse (dm-dougmorse) wrote :

[possibly SOLVED]

I have located and corrected the bug, at least in my case.

SHORT ANSWER

Edit $HOME/.local/share/applications/mimeapps.list, find the section [Added Associations] and within that section fine a line that starts with

  text/html=

and make your preferred browser the FIRST entry after the equal sign (=).

LONG ANSWER

The file $HOME/.local/share/applications/mimeapps.list seems to be the first thing checked for running a .desktop file (see attached example), even preempting System -> Preferences -> Preferred Applications and alternatives set by running "sudo update-alternatives --config x-www-browser".

The first part of my mimeapps.list file used to be:

  [Added Associations]
  text/html=opera.desktop;firefox.desktop;[....]

and I changed it to:

  [Added Associations]
  text/html=firefox.desktop;opera.desktop;[....]

As soon as I did so, double-clicking on a .desktop link / URL started opening firefox instead of opera (which is what I wanted). (Note that I also deleted the mimeinfo.cache file in the same directory, by I'm confident it was not the source of the problem -- I can explain why if needed).

Thus, it would appear that whatever entry comes FIRST on the "text/html=" line is what Gnome runs when a user double-clicks on a desktop URL file. IMHO this is a bug, as I would think that most users, such as Jakob and myself, expect the Preferred Application setting be used, not some setting in a file that we have to know about and can only affect by editing manually.

More generally, I suspect this behavior holds for all entries listed under the [Added Associations] section. I would suggest that, if more than one association exists for a file type specified in this section, Gnome then include an "Open with..." option on the right-clicking on the .desktop file, and that the subsequent dialog box allowing the user to select which program to run also have a checkbox with labeled something like "Remember this application for 'xxxx' files." When checked, Gnome would then re-order the corresponding entry in the [Added Associations] section such that the choosen application is listed first.

In other words, I think that right-clicking on a .desktop file should give the same "Open with..." options as when right-clicking on a non-.desktop file. Granted, the underlying implementation might be notably different, because Gnome would have to look *inside* the .desktop file to get the mimetype instead of just examining the filename extension, but I can't imagine that doing so would be that difficult.

Changed in nautilus:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.