Writing a web browser

Programming, for all ages and all languages.
Post Reply
srg_13

Writing a web browser

Post by srg_13 »

I thought that it would be really cool to write a web bowser. I know that it would be quite dificult, and I would probably not make anything that renders more than a text-only web page, but can anyone suggest any tutorials? I tried searching Google, but got no results.

Thanks in advance,

-Stephen
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Writing a web browser

Post by Pype.Clicker »

socket programming (whatever the language)
HTTP specifications (RFC 2616)

that should keep you busy for a moment ...

Make sure you retrieve the _official_ HTML specifications at W3, too ... not some approximate stuff that could be browser-specific :P
srg_13

Re:Writing a web browser

Post by srg_13 »

What do you think would be the best landuage to write one in? I was thinking C++ or C#, in windows.

-Stephen
JoeKayzA

Re:Writing a web browser

Post by JoeKayzA »

Steve the Pirate wrote: What do you think would be the best landuage to write one in? I was thinking C++ or C#, in windows.
Should both work fine, just depends on where you are more experienced. I can think of some browsers written in C, C++ and even Java.

cheers Joe
Kemp

Re:Writing a web browser

Post by Kemp »

You might also be interested in looking into this if you want to remove a lot of the grunt work from it.
Dex4u

Re:Writing a web browser

Post by Dex4u »

I would do the same as, i do with all new projects, that there is little or no info on, which is start at the very basic and work your way up.
In this case, i would make the simplest web page ( a hello world! web page) and make a simple offline browser to display it, wait untill you have a good offline html browser before moving to tcp/ip etc.
This is the way i will make a web browser for my OS.
srg_13

Re:Writing a web browser

Post by srg_13 »

That's a different approach than I was going to take. I was thinking of making an application that could download HTML files from the internet, and then writing the code to render it. As your way is probably better, thats the route I am going to take.

-Stephen
GLneo

Re:Writing a web browser

Post by GLneo »

best socket tutoial: http://beej.us/guide/bgnet/
works with unix, and with very very little change works with windows ;)

p.s. with windows link to ws2_32.lib
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Re:Writing a web browser

Post by Candy »

Simple and dirty:

sed -e 's/\n//g' -e 's/\<br\>/\n/g' -e 's/\<.*?\>//g' <file.html | less

Explanation: remove newlines, replace <br> with newline, remove all <...> thingies, output to scroller.
geezusfreeek

Re:Writing a web browser

Post by geezusfreeek »

In the Cocoa dev environment on OS X, you can do this without touching a line of code by just making the right connections in the interface. :P

Okay, seriously, what these other guys said.
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:Writing a web browser

Post by Solar »

If you're looking for example code, try 'links'. It's a full-fledged browser for console or framebuffer. No frills.
Every good solution is obvious once you've found it.
distantvoices
Member
Member
Posts: 1600
Joined: Wed Oct 18, 2006 11:59 am
Location: Vienna/Austria
Contact:

Re:Writing a web browser

Post by distantvoices »

cool stuff. and maybe that's my next endeavour, once the Network stack is in a useable state ;-)

I've always thought, the web controls are drawn by merely placing ui library provided controls - except of the table drawing stuff. This alone is one file for itself. Boah. Pretty advanced stuff. Well, I'm gonna extract all the nifty algorithms. *fg*

As it looks like in links, that's drawing custom controls on a drawing board and adding handling stuff to them.

Stay safe
... the osdever formerly known as beyond infinity ...
BlueillusionOS iso image
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:Writing a web browser

Post by Solar »

beyond infinity wrote: As it looks like in links, that's drawing custom controls on a drawing board and adding handling stuff to them.
Correct, as links is intended to be run from the console. No X, no toolset. ;)
Every good solution is obvious once you've found it.
Post Reply