Main menu:

Sponsoring

Please consider a small donation:

 

Also appreciated: support me by clicking the ads (costs nothing) :-)

 

Or you can donate bitcoin:

 

Thanks to TekLinks in Birmingham, AL, for providing colocation and bandwidth.

Page Rank

Fame

FOSS Force Best Blog--2013 Award

Recent posts

Recent comments

About this blog

I am Eric Hameleers, and this is where I think out loud.
More about me.

Search

My Favourites

Slackware

Calendar

August 2014
M T W T F S S
« Jul    
 123
45678910
11121314151617
18192021222324
25262728293031

RSS Alien's Slackware packages

RSS Alien's unofficial KDE Slackware packages

RSS Alien's multilib packages

Meta

Make firefox understand downloaded files

 It is quite annoying that Firefox always forgets what application to use for “opening” a file which you just downloaded. Also, the context menu “Open containing folder” in the Downloads overview does not work. Thanks to a hint from user cendryon in  a discussion at LinuxQuestions.org, a clean and simple solution surfaced which I had not thought of myself (even though I implement the same techique in my Dropbox client package):

Using “xdg-open” you can improve the integration of Firefox into your Desktop Environment a lot:

  1. Stop firefox if it is running
  2. Delete or rename the mimetypes cache (where firefox keeps its file association settings):
    $ rm ~/.mozilla/firefox/<yourprofile>/mimeTypes.rdf
  3. Start firefox again
  4. Download any file if you had not done this before
  5. Open that file from the “Tools > Downloads” menu (by right-clicking on it and selecting “Open“). When asked to choose the application for opening the fike, browse to “/usr/bin/xdg-open“. then check the checkbox to “Remember your choice“.

After you’ve configured Firefox like that, both the  “Open” and “Open containing folder” context menus will work. If you are running KDE (which was the subject of that discussion on LQ.org) you can then change the preferred programs through KDE’s “file associations” settings. Brilliant.

Have fun,

Eric

Comments

Comment from Manuel Reimer
Posted: March 16, 2012 at 06:51

https://www.libreoffice.org/bugzilla/show_bug.cgi?id=19377

I don’t know if this still is a problem, but I still think it is a bad idea to use xdg-open to handle files from web directly.

The right way would be to have Firefox directly communicate with KDE. Until this is possible, I prefer to create the list of trusted applications on my own in the Firefox helper application settings.

Comment from Kristian
Posted: March 16, 2012 at 07:07

NIce hack if it can be done safely.. Having read the post that Manuel links to I am wondering if this is still a problem.

Comment from Ferenc
Posted: March 16, 2012 at 10:13

Hi Eric,

Thanks for this it is really handy.

If only you could find out a similar way to get amarok to properly write the config file in amarokrc if you want to use MYSQL to store its data, Even up till the latest release i had to add the host manually.

Comment from dolphin77
Posted: March 16, 2012 at 11:27

I thought it is not a “workaround” but a “temporary solution”. And actually using xdg-open for years. In both thunderbird and firefox…. :)

Comment from alienbob
Posted: March 16, 2012 at 12:42

Manuel

You do as you please. The issue you reported about Slackware’s mailcap (which was again taken from Fedora) back in 2009 was fixed in KDE 4.3 (xdg-open calls kfmclient).
Since your “test case” if no longer online I could not verify and really, it is of no importance anyway.

Eric

Comment from alienbob
Posted: March 16, 2012 at 12:43

dolphin77, it is never too late for people to learn :-)

Eric

Comment from alienbob
Posted: March 16, 2012 at 12:45

Ferenc,

I package Amarok as part of KDE but I do not use it. I think it is an example of bad interface design and everytime I run it, I am confronted with things that do not work.

Eric

Comment from dolphin77
Posted: March 16, 2012 at 15:54

>Open that file from the “Tools > Downloads” menu (by right-clicking on it and selecting “Open“). When asked to choose the application for opening the fike, browse to “/usr/bin/xdg-open“. then check the checkbox to “Remember your choice“.

Well, my 2 cents. Browsing to the file takes normally quite a long time, since /usr/bin/ is very populated. Normally it is much faster just to type: /usr/bin/xdg-open and hit enter (you do not have to type in completely, since it will try to guess what you are typing in (like auto-completion).

Comment from Alex
Posted: March 17, 2012 at 10:57

Works fine in Seamonkey, too. :)
Thanks!

Comment from gauchao
Posted: March 17, 2012 at 12:26

Thank you, Eric. Nice solution.

Pingback from Make Firefox understand magnet links | some slack
Posted: May 18, 2012 at 10:49

[...] but it’s mime-handling under Linux is just plain annoying sometimes. A nice trick that can improve the integration of Firefox into your Desktop Environment is using xdg-open to open file links from Firefox’s Download window. But a magnet link (a [...]

Pingback from Seamonkey file associations | slackalaxy
Posted: June 16, 2012 at 14:22

[...] Seamonkey does not know by default how to handle downloaded files and magnet links. Solution: Read AlienBob’s and someslack blogs regularly :) The instructions for Firefox work just fine for Seamonkey. [...]

Write a comment