70

My goal is trying to run .swf files through Firefox and NOT a standalone player.

When trying to run local .swf files on Firefox 29.0 (currently on 14.04), the browser opens the Open With/Save File prompt window even if the browser has the Flash plugin installed. Right-clicking on the file and clicking Open With... > Firefox just makes the browser open a new tab and then the prompt to Open With/Save File again. Selecting Firefox through that prompt window will still just make Firefox open the prompt again on a new tab.

When accessing .swf files online, though, they run normally and Firefox even shows the Lego-looking plugin indicator in the address bar saying that "Adobe Flash" is enabled for the address I'm accessing the .swf from.

In Firefox's preferences' Applications tab, SWF Files are currently set to "Use Shockwave Flash (in Firefox)", so I don't get why it won't do what it says for the case of local files.

UPDATE: Apparently, Firefox has separate "Shockwave Flash File" entries in the Applications tab of its Preferences for different mime-types. Found a workaround which I entered below.

1
  • // , Excellent question! I really like how you laid this out. It's easy to find in search results, and describes the problem several different ways, by mentioning possibilities. Commented May 18, 2015 at 1:46

2 Answers 2

64

Found a workaround here which is based on an Arch thread here. From what I understood, it's just a problem with Firefox not properly supporting a certain mime-type.

Edit /usr/share/mime/packages/freedesktop.org.xml as root and replace the following:

<mime-type type="application/vnd.adobe.flash.movie">

With:

<mime-type type="application/x-shockwave-flash">

And then run:

sudo update-mime-database /usr/share/mime

Got local .swf files working properly now.

3
  • // , Tested. Works on my 14.10 machine with Firefox 38.0. I did get some weird errors upon the sudo update-mime-database /usr/share/mime command, though. ➜ ~ sudo vi /usr/share/mime/packages/freedesktop.org.xml [sudo] password for nathan: ➜ sudo update-mime-database /usr/share/mime Unknown media type in type 'all/all' Unknown media type in type 'all/allfiles' Unknown media type in type 'uri/mms' Unknown media type in type 'uri/mmst' Unknown media type in type 'uri/mmsu' Unknown media type in type 'uri/pnm' Unknown media type in type 'uri/rtspt' Unknown media type in type 'uri/rtspu' ➜ Commented May 18, 2015 at 1:45
  • 2
    This looks like a dirty hack to me (in contrast to the good and working answer with config file the home directory).
    – Nobody
    Commented Jan 13, 2016 at 22:32
  • 2
    The other answer is much better. Commented Feb 22, 2016 at 15:10
51

Another option is to create ~/.mime.types in the home directory with following content:

application/x-shockwave-flash       swf swfl

This way it will not get overwritten on system upgrade.

If you want you can copy, paste and run this command to do this:

echo 'application/x-shockwave-flash       swf swfl' >> .mime.types

No further commands necessary, not even a browser restart.

9
  • 1
    Do you mean create an empty document called .mime.types in the Home directory and then put the text you stated into it? Also what update-mime-database command do we use after that?
    – Ads20000
    Commented Jan 23, 2015 at 5:36
  • 6
    much simpler, convenient, and it works!
    – FairMiles
    Commented Apr 25, 2015 at 19:38
  • 3
    Yep, it doesn't.
    – Aleh
    Commented May 19, 2015 at 12:21
  • 3
    This is definitely the best method, no root access, so simple, and most importantly it just works!
    – TuxForLife
    Commented Feb 16, 2016 at 2:58
  • 2
    After doing this, since FF now blocks flash, you also need to untick the security box of the shockwave plugin preferences on the add-ons page.
    – sinekonata
    Commented Mar 5, 2019 at 19:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .