I would like to make Firefox view text files not in its internal editor, but in the external editor (namely EmacsClient).

Is it possible to change this default behavior of Firefox?

EDIT: I beg your pardon for being inconcise, I'll try to state the matter once again. First thing to mention is that I use the Linux version of Firefox. That means that unlike the Windows version the contents of the application bindings dialog is very scarce.

When I click on the link to a text file (be it remote or local) by default Firefox opens it in the internal browser. I've tested, somehow it looks at file extension - when for example I make a file with .mpg extension, the behaviour is as it should be - the dialog with "Open With..." and stuff. When the file has unknown extension (unknown to /etc/mime.types), in my case it's .out, pure text format - the default behaviour is to open it in a Firefox window. That very thing I need to change.


Try: Tools > Options > Applications, scroll down to Text Document, and change the entry there.

If the entry does not exist, you must edit the mimeTypes.rdf file in your profile directory.

  • @pepoluan: Sorry, my fault. Should have said that i'm on linux. I'll update the question. – user69285 Mar 10 '11 at 12:22
  • @pooh : um, that's the menu tree of Firefox. I've never used Firefox on Linux before, does it not have similar menu? – pepoluan Mar 10 '11 at 12:27
  • @Arjan: You got me wrong... I meant that i use the file:/// facility to browse local FS in firefox. Should have added "in firefox" to "browse", because that's where the original understanding was diverted. – user69285 Mar 10 '11 at 12:53
  • @pooh : I see... I'll edit my answer – pepoluan Mar 10 '11 at 13:22
  • @pepoluan: I think the menu tree is the same, but invoked from Edit→Preferences→Applications tab. I'll try to modify this rdf thingy but it's scary i must admit. – user69285 Mar 10 '11 at 13:28

Yes, this is possible. Have a look here: http://www.howtogeek.com/howto/2246/view-webpage-source-code-in-your-favorite-text-editor-firefox/

  • @Daniel Hilgarth: Thank You! This i've found, but the thing i want to achieve is slightly different: when i for example browse local file system, and click on a text file, it's being opened by default in a firefox browser. I need to change this behaviour so it's being opened in my editor instead. – user69285 Mar 10 '11 at 11:44
  • 1
    If normal text files are opened in firefox, your extension associations are really messed up. Just right click on the file and choose open with and choose the correct program and check the checkbox to always open that file type with that new program. – Daniel Hilgarth Mar 10 '11 at 11:47
  • @pooh, that is totally different from what you asked! But now, as there are two answers already, I feel it's too late to fix your question. If Daniel's comment does not work for you, then Why can't change the default program to open an extension in Windows 7? might help. Also, next time please indicate what you already tried. – Arjan Mar 10 '11 at 12:17
  • 1
    (@Daniel, though I see you're not new on SOFU, please see Are answers that just contain links elsewhere really “good answers”?. Thanks!) – Arjan Mar 10 '11 at 12:19
  • 1
    I think the main problem is, that your application list only contains a few types. While searching for an answer, I found this thread: bbs.archlinux.org/viewtopic.php?pid=350900. If I understand it correctly, firefox uses gnome to get the applications list with the help of some .gconf file that is in your home directory. Maybe this hint helps you find the solution. – Daniel Hilgarth Mar 10 '11 at 13:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy