68

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.

  • // , 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. – Nathan Basanese May 18 '15 at 1:46
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.

  • 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 Jan 23 '15 at 5:36
  • 1
    Yep, a plain text file. There is no need to run update-mime-database with this workaround, having this file in the home dir should be sufficient. – Aleh Jan 24 '15 at 23:51
  • 6
    much simpler, convenient, and it works! – FairMiles Apr 25 '15 at 19:38
  • 3
    Yep, it doesn't. – Aleh May 19 '15 at 12:21
  • 3
    This is definitely the best method, no root access, so simple, and most importantly it just works! – TuxForLife Feb 16 '16 at 2:58
63

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.

  • // , 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' ➜ – Nathan Basanese May 18 '15 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 Jan 13 '16 at 22:32
  • 2
    The other answer is much better. – That Brazilian Guy Feb 22 '16 at 15:10

protected by Community Mar 4 '16 at 14:25

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.