LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-31-2017, 01:53 PM   #1
MrUmunhum
Member
 
Registered: May 2006
Location: Mt Umunhum, CA, USA, Earth
Distribution: Debian/ Fedora/ Ubuntu/ Raspbian
Posts: 549

Rep: Reputation: 40
howto: view "C source" in Firefox browser Fedora 23


Hi group,
I would like Firefox to open C source code in a new tab. I go to Preference-> applications -> C source code, use the pull down and all I get is
  • Allways Ask
  • Save file
  • Xemacs
  • Use other
No other options!

How do I get Firefox to open C source code file to view code in a new tab?

Thanks for your time.
 
Old 01-31-2017, 02:50 PM   #2
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Linux From Scratch, Slackware64, Partedmagic
Posts: 2,940

Rep: Reputation: 780Reputation: 780Reputation: 780Reputation: 780Reputation: 780Reputation: 780Reputation: 780
This works for me ( though I don't use firefox much ), just go to Preference-> applications -> C source code, select "other", navigate to firefox ( on my system /usr/bin/firefox ), or type the address into the location bar, select open and close the prefs, 1st time i did this firefox went nutso, so may be a good idea to close firefox before opening a c file after that was ok.
 
Old 01-31-2017, 04:05 PM   #3
MrUmunhum
Member
 
Registered: May 2006
Location: Mt Umunhum, CA, USA, Earth
Distribution: Debian/ Fedora/ Ubuntu/ Raspbian
Posts: 549

Original Poster
Rep: Reputation: 40
Quote:
Originally Posted by Keith Hedger View Post
This works for me ( though I don't use firefox much ), just go to Preference-> applications -> C source code, select "other", navigate to firefox ( on my system /usr/bin/firefox ), or type the address into the location bar, select open and close the prefs, 1st time i did this firefox went nutso, so may be a good idea to close firefox before opening a c file after that was ok.
Did what you said and you're right Firefox went crazy, opening endless window tabs. To the point I had to crash it. Repeated, same errors.
 
Old 01-31-2017, 04:43 PM   #4
MrUmunhum
Member
 
Registered: May 2006
Location: Mt Umunhum, CA, USA, Earth
Distribution: Debian/ Fedora/ Ubuntu/ Raspbian
Posts: 549

Original Poster
Rep: Reputation: 40
I tried writing a php script to list the source file and output in a table, it just downloaded the file, ran the script put it in /tmp but did not open it.

My script:
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <style type="text/css"> body, td { font-size: 16; font-family: sans-serif;    }
    </style>
  </head> <body>
  <table border="0">
    <tr><td>Line</td><td><center>Code</center></td></tr>
<?php
    $File = fopen( $argv[1], "r" );
    $Num = 1;
    while(( $Line = fgets( $File, 4096) ) !== false )  {
       echo "<tr><td  style=\"vertical-align: top;\">";
       echo "$Num</td><td>$Line</td></tr>";
       $Num++;  }
    ?>
    </table>
  </body>
</html>
Should have worked!

Last edited by MrUmunhum; 01-31-2017 at 05:18 PM. Reason: start count at 1
 
Old 01-31-2017, 06:04 PM   #5
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,522

Rep: Reputation: 2619Reputation: 2619Reputation: 2619Reputation: 2619Reputation: 2619Reputation: 2619Reputation: 2619Reputation: 2619Reputation: 2619Reputation: 2619Reputation: 2619
why do you want to use the old and not updated firefox on the UNSUPPORTED Fedora 23

Fedora 23 went END OF LIFE on 2016-12-20

firefox would not be a good tool for reading c and c++ code and .h files

gedit or kate or emacs or vim would be better options
they have code coloring and "[]" bracketing Matching and highlighting

as for opinning things in a new tab

that is a firefox option that i set in " edit / preferences / general tab
and check "Open new windows in a new tab instead"
 
Old 01-31-2017, 07:29 PM   #6
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Linux From Scratch, Slackware64, Partedmagic
Posts: 2,940

Rep: Reputation: 780Reputation: 780Reputation: 780Reputation: 780Reputation: 780Reputation: 780Reputation: 780
i agree with john a browser is not the best thing to view code in anyway you would be much better off with a proper code editor with syntax highlighting etc, see my sig for the best one
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
search for "standalone" working browser (firefox) surfin_eddie Linux - Software 5 04-29-2014 06:14 AM
LXer: Mozilla's "modern browser" attack on IE overlooks Firefox shortcomings LXer Syndicated Linux News 0 02-18-2011 08:20 PM
"Multicolumn" or "tiles", or even "list" icon view on desktop, in any DE? the dsc Linux - Desktop 3 02-20-2010 09:25 AM
Bluefish - "View browser" button doesn't work Fedora 9 zed420 Fedora 2 02-26-2009 10:30 PM
"OpenOffice.org could not find a web browser" but launches Firefox anyway BuilderQ Linux - Software 0 10-23-2007 12:25 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:28 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration