Often times I'll click on a random link to a .sh or .py or .cpp or ... file in Firefox, and all I want is to view the code. I don't have a Firefox handler set up for every text file extension under the sun, and I don't want to have to. Is there an easy way to force Firefox to view the file as text instead of trying to save (or open in external app)?
Asked
Active
Viewed 1.1k times
21
I say Reinstate Monica
- 25,487
- 19
- 95
- 131
davr
- 5,368
- 7
- 37
- 46
-
2Possible same on SO: http://stackoverflow.com/questions/9191925/how-to-force-firefox-to-open-a-file-which-does-not-have-a-txt-extension-as-if-i – Ciro Santilli OurBigBook.com Apr 23 '15 at 05:50
3 Answers
17
Maybe you should give this addon a try. I've never used it but it looks like it might work for you.
djhowell
- 3,721
- 1
- 22
- 22
-
-
3Good old firefox...this was originally reported as a bug 9 years ago. This extension was made 3 years ago. Bug still not fixed...but at least I can use the extension. – davr Sep 18 '09 at 21:13
-
1Yes this is a great addon. It's really annoying that the world is moving away for this way of working (take chrome that wants to save everything) – Davide Jun 30 '14 at 16:31
-
Yes, the [Open in Browser](https://addons.mozilla.org/en-US/firefox/addon/open-in-browser/) add-on is the best solution until something as simple is integrated into Firefox (but I fear it never will...). – mivk Mar 11 '21 at 15:57
0
Answered HERE
to display file add below line(s) in .htaccess
AddType text/plain .txt
AddType text/plain .log
This is signal Firefox that you don't have to download the file instead view file as plain text.This technique can be applied to all the files that you need to view instead off download.
Azmat Karim Khan
- 119
- 2
-
3This is server-side configuration. If it is configured properly, things work. But more often than not it is configured wrong, and the point is working around that bad configuration. – Jan Hudec Sep 03 '19 at 09:03
0
Open options and go to the applications tab, maybe that will help. Other than that, I'm not sure. Try searching for an extension.
Linus
- 697
- 3
- 10
-
Applications tab: that would require me to add something for each and every file type, I was hoping to do it all at once. extension: I looked, but couldn't find any that did what I wanted. Hence why I am asking on here – davr Sep 18 '09 at 16:29