How to prevent Firefox from opening up too many tabs

1

I wanted to view .cpp source code in FireFox so I selected FireFox as the application to open it with and checked "always do this" but when I clicked the link new tabs kept opening up and wouldn't stop. I simply want to view .cpp files in FireFox how can I do this and why didn't it work?

I'm viewing a website with a link to a .cpp file and I want to click the link and show the text in the browser. I'm using latest FireFox on Windows 7 Enterprise.

Celeritas

Posted 2012-07-30T22:37:20.507

Reputation: 7 487

Answers

3

  • Using explorer, go to a .cpp file right click -> select properties.
  • There is a section in the 'General' tab which shows the program that opens this file.
    • XP systems click the Opens with... button (In Vista/7, the button says Change...)
  • Select a text editor instead of firefox.

Firefox is not made to see source code other than .htm/.html and text .txt files. You'd be better off using a specialized text editor like Notepad++ wich is free and a great choice for source code/files.

After having chosen a text editor click Apply and hit OK button. You are now good to go. Hope this helps you out. This is a simple solution.

Tnkizh

Posted 2012-07-30T22:37:20.507

Reputation: 46

Why can't FireFox view .cpp files, they are just text? – Celeritas – 2012-07-31T04:00:35.283

@Celeritas - because according to Firefox .cpp isn't plain text. If you really want firefox to treat .cpp as text I suggest having a look at kenorb's answer - you'll need to change firefox's definition of plain text to include files ending in .cpp – Robotnik – 2012-08-01T06:20:21.793

2

Depending on your system, you can add .cpp format as a known mimetype of plain/text or whatever. See: Properties -> Applications. Try as well dragging the file into your Firefox instance. Other workaround is to change the extension of your cpp to txt or html. I'm not sure which Firefox are you using, but mine 14.0.1 opening .c and .cpp files without any problems (without any configuration changes), so also I'd advise you to upgrade your Firefox.

P.S. Still don't understand how your new tabs kept opening up and wouldn't stop (what exactly happening). You don't mention your version or OS. And what are you trying to do exactly, to open .cpp from the websites, or open .cpp files which is on your local computer.

kenorb

Posted 2012-07-30T22:37:20.507

Reputation: 16 795

i've had it happen before, I accidentally told firefox to "always open this file type with" and chose firefox, thinking it would just preview the file. what firefox gets caught in a loop doing is opening a new tab, and doing the default action for that file, which is "open with firefox" which opens a new tab, so on, so forth – Robotnik – 2012-07-31T01:09:00.773