Why can't Firefox run local .swf files?
Solution 1
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.
Solution 2
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.
maki57
Updated on September 18, 2022Comments
-
maki57 over 1 year
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.
-
Nathan Basanese almost 9 years// , 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.
-
-
Ads20000 over 9 yearsDo 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?
-
Aleh over 9 yearsYep, 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.
-
FairMiles about 9 yearsmuch simpler, convenient, and it works!
-
Nathan Basanese almost 9 years// , 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 almost 9 years// , This doesn't require super-user privileges with
sudo
, right? -
Aleh almost 9 yearsYep, it doesn't.
-
Nobody over 8 yearsThis looks like a dirty hack to me (in contrast to the good and working answer with config file the home directory).
-
TuxForLife about 8 yearsThis is definitely the best method, no root access, so simple, and most importantly it just works!
-
That Brazilian Guy about 8 yearsThe other answer is much better.
-
ether_joe over 7 yearsholy crap that worked right out of the box!
-
l0b0 about 7 yearsEven simpler:
echo 'application/x-shockwave-flash swf swfl' >> ~/.mime.types
-
sinekonata about 5 yearsAfter 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.