I'm quite annoyed with my firefox and Flash files :

When I try opening a .swf file with it:

  • If the file is on the web (via http://...), it plays normally in browser
  • If the file is local (via file:///...), firefox only show me a dialog to download it

It tried opening a web swf file, downloading it then opening it locally, it's the same. So I guess it's a firefox problem.

I'm on Gentoo Linux, and it started today, without any apparent reason.

  • Have you updated Firefox recently? – Ramhound Dec 12 '13 at 14:31
  • @Ramhound I reinstalled it some days ago adding support for french, but it was not an update. – Levans Dec 12 '13 at 16:34
up vote 7 down vote accepted

After some digging into this myself, I've discovered it is a MIME type issue. Firefox (or Chrome) on Linux won't play SWF files if it thinks the type is application/vnd.adobe.flash.movie.

Per https://askubuntu.com/questions/478169/why-cant-firefox-run-local-swf-files:

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:

update-mime-database /usr/share/mime

I found I needed to restart Firefox after. Here's a script very close to one from http://ubuntuforums.org/showthread.php?t=2218732&page=2 that performs these steps (run it with sudo), but I will warn you -- I noticed that different installs seem to have different spacing, which can trip up the sed script, which is what happened to me.

#!/bin/bash
clear
echo "Update file freedesktop.org.xml...";
sed  -e "s/<mime-type type=\"application\/vnd.adobe.flash.movie\">/<mime-type type=\"application\/x-shockwave-flash\">/g"  /usr/share/mime/packages/freedesktop.org.xml >  /usr/share/mime/packages/freedesktop.org.xml.new
mv /usr/share/mime/packages/freedesktop.org.xml /usr/share/mime/packages/freedesktop.org.xml.original
mv /usr/share/mime/packages/freedesktop.org.xml.new /usr/share/mime/packages/freedesktop.org.xml
echo "File updated successfully!";
echo "Update mime database...";
update-mime-database /usr/share/mime
echo "Mime database updated successfully! ALL DONE!";
  • 1
    Did the modification by hand, works perfectly ! – Levans Jul 1 '14 at 19:46
  • this is just bad but i can't really expect much since it is from the ubuntuforums, if you just replace vnd.adobe.flash.movie with x-shockwave-flash in the mimetype and don't replace x-shockwave-flash with vnd.adobe.flash.movie in the alias, then the computer wouldn't be able to handle vnd.adobe.flash.movie anymore. also, i highly recommend a local edit instead of a system wide edit, eg: make a small file in ~/.local/share/mime/packages/ with the mimetype define, then use update-mime-datebase ~/.local/share/mime/packages/ – freeforall tousez Jan 28 '15 at 23:00

note that this is an addition to Arthur Shipkowski's answer, https://superuser.com/a/775669/238284

if you don't have root access and/or want a workaround without messing with the internal system, you can just make a file and place it in ~/.local/share/mime/packages/.

  1. make a file in ~/.local/share/mime/packages/, you can name it anything you want as long as it ends with .xml but i recommend naming it x-shockwave-flash.xml
  2. open the file, copy and paste (or manually type) the code below then save the file
  3. run update-mime-datebase ~/.local/share/mime

x-shockwave-flash.xml: <?xml version="1.0" encoding="UTF-8"?> <mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info"> <mime-type type="application/x-shockwave-flash"> <comment>Shockwave Flash file</comment> <comment xml:lang="ar">ملف Shockwave Flash</comment> <comment xml:lang="be@latin">Fajł Shockwave Flash</comment> <comment xml:lang="bg">Файл — Shockwave Flash</comment> <comment xml:lang="ca">fitxer Shockwave Flash</comment> <comment xml:lang="cs">Soubor Shockwave Flash</comment> <comment xml:lang="da">Shockwave Flash-fil</comment> <comment xml:lang="de">Shockwave-Flash-Datei</comment> <comment xml:lang="el">αρχείο Shockwave Flash</comment> <comment xml:lang="en_GB">Shockwave Flash file</comment> <comment xml:lang="eo">dosiero de Shockwave Flash</comment> <comment xml:lang="es">archivo Shockwave Flash</comment> <comment xml:lang="eu">Shockwave Flash fitxategia</comment> <comment xml:lang="fi">Shockwave Flash -tiedosto</comment> <comment xml:lang="fo">Shockwave Flash fíla</comment> <comment xml:lang="fr">fichier Shockwave Flash</comment> <comment xml:lang="ga">comhad Shockwave Flash</comment> <comment xml:lang="gl">ficheiro sockwave Flash</comment> <comment xml:lang="he">קובץ של Shockwave Flash</comment> <comment xml:lang="hr">Shockwave Flash datoteka</comment> <comment xml:lang="hu">Shockwave Flash-fájl</comment> <comment xml:lang="id">Berkas Shockwave Flash</comment> <comment xml:lang="it">File Shockwave Flash</comment> <comment xml:lang="ja">Shockwave Flash ファイル</comment> <comment xml:lang="kk">Shockwave Flash файлы</comment> <comment xml:lang="ko">Shockwave 플래시 파일</comment> <comment xml:lang="lt">Shockwave Flash failas</comment> <comment xml:lang="lv">Shockwave Flash datne</comment> <comment xml:lang="ms">Fail Shockwave Flash</comment> <comment xml:lang="nb">Shockwave Flash-fil</comment> <comment xml:lang="nl">Shockwave Flash-bestand</comment> <comment xml:lang="nn">Shockwave Flash-fil</comment> <comment xml:lang="pl">Plik Shockwave Flash</comment> <comment xml:lang="pt">ficheiro Shockwave Flash</comment> <comment xml:lang="pt_BR">Arquivo Shockwave Flash</comment> <comment xml:lang="ro">Fișier Shockwave Flash</comment> <comment xml:lang="ru">файл Shockwave Flash</comment> <comment xml:lang="sk">Súbor Shockwave Flash</comment> <comment xml:lang="sl">Datoteka Shockwave Flash</comment> <comment xml:lang="sq">File Flash Shockwave</comment> <comment xml:lang="sr">Шоквејв Флеш датотека</comment> <comment xml:lang="sv">Shockwave Flash-fil</comment> <comment xml:lang="uk">файл Shockwave Flash</comment> <comment xml:lang="vi">Tập tin Flash Shockwave</comment> <comment xml:lang="zh_CN">Shockwave Flash 文件</comment> <comment xml:lang="zh_TW">Shockwave Flash 檔</comment> <alias type="application/vnd.adobe.flash.movie"/> <alias type="application/futuresplash"/> <generic-icon name="video-x-generic"/> <magic priority="50"> <match value="FWS" type="string" offset="0"/> <match value="CWS" type="string" offset="0"/> </magic> <glob pattern="*.swf"/> <glob pattern="*.spl"/> </mime-type> </mime-info>

This was apparently a problem with some versions of Firefox, as I have experienced the same change of behavior after upgrading to somewhere between versions 25 and 26.

I have used the Debian and the problem was with the changes in the MIME definitions in the system configuration. Firefox seemed to not conform to these changes.

After the update to then-latest Firefox, which was version 28, problem was solved, SWF files from file:// protocol begin opening as usual, as before.

  • 1
    Just in case this reappears for you, I've posted a direct fix as another answer. – Arthur Shipkowski Jul 1 '14 at 18:56

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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