Jump to content

  • Log In with Google      Sign In   
  • Create Account


[SOLVED] What is a browser?

  • You cannot reply to this topic
36 replies to this topic

#21 Karsten_   Members   -  Reputation: 1494

Like
5Likes
Like

Posted Yesterday, 04:29 PM

Web browser can be quite simple.

Three of the best examples are

 

 

Neither of these use OpenGL or DirectX.

 

The main consumer web browsers like Firefox, Chrome and IE are horrendously bloated and use Javascript for things they probably shouldn't be (I am looking at you Firefox download manager!)

 

If you want to make a web browser, you do not really need much code these days if you leverage the rendering engines provided by these projects. You might want to look into:

 

There are loads more. One word of warning though is that they do drag in a lot of dependencies into your project and the Microsoft WebBrowser route is very unportable (Though probably the easier solution for Windows users).


Edited by Karsten_, Yesterday, 04:29 PM.

Mutiny - Open-source C++ Unity re-implementation.
Defile of Eden 2 - FreeBSD and OpenBSD binaries of our latest game.


Sponsor:

#22 RoundPotato   Members   -  Reputation: 68

Like
-2Likes
Like

Posted Yesterday, 05:07 PM

Guys, you are misinterpreting my question, your answers are great(covering the overview description, usage and different functionality it supports).

But like attempted to emphasise "Using what is Firefox and chrome made of? (just made of, NOT what it supports.)" In the sense that it's simply made of C++ and OpenGL/DirectX, REGARDLESS of it it supporting a lot of error corrections, file formats, interpretation of higher scripting languages, etc, etc.(After reading that software rendering may not involve a GPU thus rendering APIs such as OpenGL/DirectX useless I see where you were coming from, but consider a typical/most common usage on average computer with a GPU with and average user) I'm sure you can sit there for hours listing what makes up a proper web browser.

 

All of the functional support is implemented using C++(or other language) and rendering( graphical interface components, images, fonts ,ect ect) is DirectX/OpenGL, so repeating myself it's just a program written in C++(or other) and OpenGL/DirectX.

 

After having read the above, can you confirm that, or am I missing/misunderstanding something?


Edited by RoundPotato, Yesterday, 05:09 PM.


#23 Takemura   Members   -  Reputation: 120

Like
1Likes
Like

Posted Yesterday, 05:20 PM

Guys, you are misinterpreting my question, your answers are great(covering the overview description, usage and different functionality it supports).

But like attempted to emphasise "Using what is Firefox and chrome made of? (just made of, NOT what it supports.)" In the sense that it's simply made of C++ and OpenGL/DirectX, REGARDLESS of it it supporting a lot of error corrections, file formats, interpretation of higher scripting languages, etc, etc.(After reading that software rendering may not involve a GPU thus rendering APIs such as OpenGL/DirectX useless I see where you were coming from, but consider a typical/most common usage on average computer with a GPU with and average user) I'm sure you can sit there for hours listing what makes up a proper web browser.

 

All of the functional support is implemented using C++(or other language) and rendering( graphical interface components, images, fonts ,ect ect) is DirectX/OpenGL, so repeating myself it's just a program written in C++(or other) and OpenGL/DirectX.

 

After having read the above, can you confirm that, or am I missing/misunderstanding something?

Alright,I hate for this to be my first post.. But honestly.

Why ask for help when you are not willing to listen to other peoples ideas? You need to leave your shell. They are trying their best to help you and inform you that they DON'T Merely use directx/opengl. Some of the people even listed libraries you can use that will help you in creating a 'simple' browser.

 

If you are not getting the answers you seek, the reason is that you yourself are not being clear on what you are seeking.


Edited by Takemura, Yesterday, 05:21 PM.


#24 RoundPotato   Members   -  Reputation: 68

Like
-2Likes
Like

Posted Yesterday, 05:34 PM

Alright,I hate for this to be my first post.. But honestly.
Why ask for help when you are not willing to listen to other peoples ideas? You need to leave your shell. They are trying their best to help you and inform you that they DON'T Merely use directx/opengl. Some of the people even listed libraries you can use that will help you in creating a 'simple' browser.
 
If you are not getting the answers you seek, the reason is that you yourself are not being clear on what you are seeking.

That is why I tried to get my point across in my latest post, highlighting key words/points in bold and providing clarifications in parenthesis. From your reply I can clearly tell you either failed to read that, or didn't read that at all.



#25 Ectara   Crossbones+   -  Reputation: 2819

Like
3Likes
Like

Posted Yesterday, 05:36 PM

In the sense that it's simply made of C++ and OpenGL/DirectX,

You can compile Firefox with hardware acceleration support removed, voiding your claim.
 
Note that since a lot of the Firefox UI and preference engine uses JavaScript, this voids the claim that C++ is all that's used to write the program.
 
 
 

rendering( graphical interface components, images, fonts ,ect ect)

A lot of the font rendering and GUI is GTK+ in Linux. Look up windowing toolkits!
 
 
 

After having read the above, can you confirm that, or am I missing/misunderstanding something?

YES!
 
Please, please look up any of the terms in this thread in Google. It sounds like you decided that Firefox is just C++ and Direct3D/OpenGL, and you're going to repeat your question until we agree with you.

Edited by Ectara, Yesterday, 10:33 PM.


#26 Nypyren   Crossbones+   -  Reputation: 3722

Like
4Likes
Like

Posted Yesterday, 05:37 PM

(random flailing)


The entire first page answered every possible interpretation of your question, EVEN AFTER YOU CHANGED IT. At this point, perhaps you're just trolling?

#27 Karsten_   Members   -  Reputation: 1494

Like
3Likes
Like

Posted Yesterday, 05:54 PM

All of the functional support is implemented using C++(or other language) and rendering( graphical interface components, images, fonts ,ect ect) is DirectX/OpenGL, so repeating myself it's just a program written in C++(or other) and OpenGL/DirectX.

 

After having read the above, can you confirm that, or am I missing/misunderstanding something?

 

Like I said. Web Browsers exist that do not use OpenGL or DirectX. So your assumption above is incorrect.

 

Web Browsers using DirectX or OpenGL is actually quite a new thing that came along with the early spec of HTML5 (i.e for accelerated 2D drawing). NetSurf just uses plain old Gtk+ and Cairo to render pages (not OpenGL). IE6 uses GDI+ to render pages and not DirectX.

 

Some of the recent common browsers however do use OpenGL or DirectX but only optionally. If for example the machine does not have a graphics card or is rendered via remote desktop / X11 forwarding, it may fall back to software (Or likely emulate OpenGL / DirectX in software).

 

But yes, a web browser is just a program written in a programming language. Likely by a human!


Edited by Karsten_, Yesterday, 06:00 PM.

Mutiny - Open-source C++ Unity re-implementation.
Defile of Eden 2 - FreeBSD and OpenBSD binaries of our latest game.


#28 SeanMiddleditch   Members   -  Reputation: 3927

Like
3Likes
Like

Posted Yesterday, 06:27 PM

so repeating myself it's just a program written in C++(or other) and OpenGL/DirectX.


Yes, you could theoretically replicate 1990's-era browsers with just C++ and a basic windowing/input/render library (you could use Direct3D/OpenGL for the rendering part if you wish).

See libRocket for an example of a pure C++ library that implements some of HTML4 and CSS2 and allows you to plug in a Direct3D or OpenGL renderer and then combine this with a pure C++ JavaScript interpreter like TinyJS or the standalone versions of Spidermonkey and add networking support using a mostly-pure C++ library like Boost.ASIO then toss in basic window creation and input handling using a C++ library like SFML and there you'd have an example of a (more or less useless) browser that is (almost) just C++ and Direct3D/OpenGL.


However, a modern browser makes use of a wide variety of OS-specific APIs for high-performance networking, audio, high-performance/encrypted multimedia support, fullscreen support, various input devices, geolocation APIs, notification APIs, some kind of video display (which may be Direct3D/OpenGL or it could be a simpler 2D graphics API), security and sandboxing APIs, memory execution control for JIT compilation of scripts, integration with default file/URI facilities in the OS (so clicking a link in an email will open your browser), font lookup/detection, battery monitoring, accelerometers, filesystem inspection, etc.

These APIs are not really optional. They are parts of the HTML5 specification and plenty of Web sites/applications require these features. Lacking them would mean you'd be unable to use common sites like Youtube or even Facebook properly (or at all). A modern browser is basically an operating system that's bundled with its own VM; they're not at all "just" applications.

#29 RoundPotato   Members   -  Reputation: 68

Like
-1Likes
Like

Posted Yesterday, 06:51 PM

The entire first page answered every possible interpretation of your question, EVEN AFTER YOU CHANGED IT. At this point, perhaps you're just trolling?

 
No, it's either I lack understanding(which is why I'm asking for help in the first place) or I'm failing to get my point across. And it's hard to tell the difference between hose two because it can go both ways.
 

 

 

 

In the sense that it's simply made of C++ and OpenGL/DirectX,

You can compile Firefox with hardware acceleration support removed, voiding your claim.
 
Note that since a lot of the Firefox UI and preference engine uses JavaScript, this voids the claim that C++ is all that's used to write the program.

 

Hardware acceleration removal would mean no OpenGL/DirectX is being used?
 
Usage of Javascript means that is another language used besides the core C++ , so that is the reason that you cannot agree to the subset of my statement "it's simply C++"? (Javascript is a full fledged programming language that works is slow only because it is interpreted, right?(something mixed up in my head that it is based on C/C++)).
 
 

A lot of the font rendering and GUI is GTK+ in Linux. Look up windowing toolkits!

 

Since GTK+ version 3, all the rendering is done using Cairo.

 
Meaning
 

Cairo (stylized as cairo) is a library used to provide a vector graphics-based, device-independent API for software developers

 
Meaning it is also a rendering API such as OpenGL and DirectX but is neither of the, nor is based on them? (If that is so then this was the reason you would not agree with the seconds subset of my statement "It is simply... DirectX/OpenGL"?)
 
 
 
Based on answer by SeanMiddleditch I believe I can further refine my question and state:

 

Such browsers are simply programs that use C++ and OpenGL/DirectX(Latter if hardware acceleration is used?) for a subset of core functionality that involves networking and displaying obtained data like images. Menus and similar "Control Graphical components" are usually implemented using other libraries, but can be implemented using one of (many?) rendering APIs like OpenGL and/or DirectX.

 

Is this correct?


Edited by RoundPotato, Yesterday, 06:56 PM.


#30 Ectara   Crossbones+   -  Reputation: 2819

Like
1Likes
Like

Posted Yesterday, 07:05 PM


Hardware acceleration removal would mean no OpenGL/DirectX is being used?

Yes, only as an after-thought for speed if enabled during build.

 


Usage of Javascript means that is another language used besides the core C++ , so that is the reason that you cannot agree to the subset of my statement "it's simply C++"?

"Usage of another language means that another language is used, so is that the reason that you cannot agree to my statement that only one language is used?"

 


Meaning

Did you seriously skip the whole article, looking for the first link? The fact that it uses Cairo is irrelevant: it is what it does, not how.

 


Menus and similar "Control Graphical components" are usually implemented using other libraries, but can be implemented using one of (many?) rendering APIs like OpenGL and/or DirectX.

What if I told you that window toolkits like GTK+ don't need to and probably don't use OpenGL/Direct3D? 3D hardware rendering is unnecessary.



#31 Servant of the Lord   Crossbones+   -  Reputation: 17205

Like
0Likes
Like

Posted Yesterday, 08:59 PM

The thread title is, "What is a browser?"; you've asked multiple questions, hence multiple answers.
 

All of the functional support is implemented using C++(or other language) and rendering( graphical interface components, images, fonts ,ect ect) is DirectX/OpenGL, so repeating myself it's just a program written in C++(or other) and OpenGL/DirectX.

After having read the above, can you confirm that, or am I missing/misunderstanding something?


They are normal computer programs, yes. Just like Microsoft Word or Microsoft Excel. Browsers that are modern-day feature-complete like Firefox are also fairly complex, just like Microsoft Word and Microsoft Excel.

'Normal computer programs' can be programmed in any language that can generate regular executables. So, yes, C++ is a likely bet for Firefox. It could've just as easily been coded in Python or Java or C#.

You are misunderstanding DirectX and OpenGL. While they likely do use DirectX and OpenGL on some level, they don't have to. They could've just as easily done their rendering in SDL or any other graphics library. Infact, Firefox used to use Cairo, and now uses a different API. Technically, Microsoft Windows could (and maybe does) still use DirectX behind the scenes to visually present the windows, but most programmers wouldn't say Firefox "uses" DirectX.
 
Technically, Firefox could use Cairo, with an OpenGL backend, using Angle to convert the calls to DirectX, running in WARP software mode, rendering to a Direct2D window, that presents the window behind the scenes using DirectXwacko.png

 

I'm not saying that this is what is actually happening, but such things are possible. So "technically" Firefox could be using, calling, or interacting with on some level DirectX, but it still wouldn't have to be "written in" DirectX.
 
DirectX is not a requirement, though the Operating System (or other APIs you might be using) may happen to use DirectX behind the scenes. smile.png


It's perfectly fine to abbreviate my username to 'Servant' rather than copy+pasting it all the time.

[Fly with me on Twitter] [Google+] [My broken website]

All glory be to the Man at the right hand... On David's throne the King will reign, and the Government will rest upon His shoulders. All the earth will see the salvation of God.                                                                                                                                                       [Need free cloud storage? I personally like DropBox]

Of Stranger Flames - [indie turn-based rpg set in a para-historical French colony] | Indie RPG development journal


#32 Tutorial Doctor   Members   -  Reputation: 1438

Like
0Likes
Like

Posted Yesterday, 09:24 PM

I had to read through all of these posts several times to see where the miscommunication was.

I guess the general answer is that in order to make a browser like Firefox or Chrome or a Internet Explorer, you have to have some way to render the graphics, and some way to program the functionality.

Direct3D/OpenGL are potential rendering APIs that "can" be used for rendering, but they are not necessary.

C++, Python, JAVA, C# etc, are programming languages that "can" provide the functionality.


And as Samith said:

"Internet browsers are responsible for interpreting and executing HTML, CSS, XML and Javascript. PHP is a server side technology, your web browser doesn't know anything about PHP.

The parsing and executing of HTML/Javascript/etc can obviously be done in C++."

So, there is a lot that "can" go into modern browsers, but basically they just need to be able to communicate with servers and retrieve and display data (http protocol)

They don't even have to have graphics (maybe text)

They call me the Tutorial Doctor.


#33 RoundPotato   Members   -  Reputation: 68

Like
-1Likes
Like

Posted Today, 01:10 AM

"Usage of another language means that another language is used, so is that the reason that you cannot agree to my statement that only one language is used?"

 
I'm having trouble explaining/clarifying to you guys so I'm dumbing the language down to basic logic.
 
 

Did you seriously skip the whole article, looking for the first link? The fact that it uses Cairo is irrelevant: it is what it does, not how.

 
What article? And how does it do whatever it does?
 
 

What if I told you that window toolkits like GTK+ don't need to and probably don't use OpenGL/Direct3D? 3D hardware rendering is unnecessary.

 
So what you are saying is speed from a GPU is not crucial to GTK+ and the like so it uses Software rendering instead. Again you are putting an emphasis that Software rendering a basic third option to those two APIs?
 

 

 

While they likely do use DirectX and OpenGL on some level, they don't have to. They could've just as easily done their rendering in SDL or any other graphics library.


Simple DirectMedia Layer is a cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL and Direct3D.

So it's kind of the same thing, just a wrapper.

 

 


You are misunderstanding DirectX and OpenGL.
 
If that's the case then I'm struggling to figure out what they are. The way I see it they are the two main Common Denominators for Graphics that actually render(in the sense that it's not CPU/software rendering but using a GPU). Am I wrong, what the deal here?
 
Cairo is just a software rendering API isn't it?
 
 
 

Direct3D/OpenGL are potential rendering APIs that "can" be used for rendering, but they are not necessary.
 
C++, Python, JAVA, C# etc, are programming languages that "can" provide the functionality.
 
 
I'd take it that C++ and other language are used as long as it's convenient, simple as that.
 
What I'm interested in is the First sentence, yet again this question arises based on the fact that I don't know(see the above question in reply to 'Servant of the Lord'), why is it not necessary, is it because software rendering(a.k.a no GPU/CPU rendering) is another choice or is there something else? I am interested in the context of browsers actually displaying stuff, not text-based browsers.

 



#34 Buster2000   Members   -  Reputation: 1429

Like
2Likes
Like

Posted Today, 04:38 AM

Wouldn't this thread be a lot shorter if somebody just pointed out that most modern browsers are open source so you can just go and look at what they are made of:

 

http://www.chromium.org/developers/how-tos/get-the-code

 

https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Source_Code/Downloading_Source_Archives

 


Cairo is just a software rendering API isn't it?

 

No it isn't.



#35 jbadams   Senior Staff   -  Reputation: 17272

Like
1Likes
Like

Posted Today, 06:59 AM

A web browser is a program just like any other on your computer, and it could potentially be written in almost any popular programming language including C++.

Like any piece of software with graphical output it needs to use a graphics API to draw to the screen. That could be DirectX or OpenGL, or it could be any other API which provides the necessary capabilities, such as GDI on Windows amongst other alternatives.

#36 Servant of the Lord   Crossbones+   -  Reputation: 17205

Like
2Likes
Like

Posted Today, 11:18 AM

 

While they likely do use DirectX and OpenGL on some level, they don't have to. They could've just as easily done their rendering in SDL or any other graphics library.


Simple DirectMedia Layer is a cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL and Direct3D.

So it's kind of the same thing, just a wrapper.

Everything is a wrapper over something else. Even DirectX is just a wrapper around each videocard's unique card-specific hardware assembly language.
 
If you dismiss something as "just a wrapper", then you can't say they are written "in" DirectX. Ultimately, everything is made of assembly, as you know. Different assembly languages for CPUs and unique assembly languages for GPUs. With CPUs we have an intermediate assembly language, so many types of CPUs can share that "lowest common denominator" in common, but that's not really the point.

The point is: Web browsers are made of the exact same "stuff" videogames and Microsoft Office, and Notepad and

They can use any language and any API they want to, as long as the resulting program runs properly on our computers. The fact that some of them just so happen to use C++ and some of them maybe might use DirectX unintentionally at some point of their multi-layered APIs is inconsequential.

You asked multiple questions, so we're giving different answers to different questions.

Your questions were:
A) What is a browser?
See my first post.

B) Browsers like firefox, chrome, etc. Aren't they simply DirectX/OpenGL applications?
No, they are regular computer programs, but they don't need to use DirectX or OpenGL.

C) So [people in general] could use C++ and Direct3D 11 to make a browser like firefox?
Yes, they can choose to use that language and that API and make a browser if they wanted to. They wouldn't be bad choices.

D) So say I could [on my own] make a [feature-complete] browser like firefox [from scratch]?
Not really, they are very very large multi-person projects. Making them from scratch AND making them feature-complete is nowadays too complex of a job for a single person. Even Google when making Google Chrome used WebKit so the vast majority of the complex work was already done for them. Later, they forked WebKit, and the forked version is what Chrome currently uses.

E) So say I could [on my own] make a [simple, not feature-complete] browser?
Yep. See Karsten_'s answer.

F) So say I could [on my own] make a [feature-complete or semi-feature-complete] browser like firefox [using pre-made components like Google did]?
Yep - see my first post for the API I suggest.
 

 

You are misunderstanding DirectX and OpenGL.


If that's the case then I'm struggling to figure out what they are. The way I see it they are the two main Common Denominators for Graphics that actually render(in the sense that it's not CPU/software rendering but using a GPU). Am I wrong, what the deal here?

You're very close. They don't have to run on the GPU, and even when they are running on a GPU, they don't have to have all their code running on the GPU. They both define specifications, and others write 'drivers' to fit those specifications. How the drivers go about doing what the specification says is up to the driver - and what mix of hardware they use is also up to the driver.

Also, browsers don't need to be hardware accelerated. It wouldn't be unreasonable to make a pure-CPU browser, and until recently most browsers were running on the CPU (now they are mostly CPU with a little bit GPU).


It's perfectly fine to abbreviate my username to 'Servant' rather than copy+pasting it all the time.

[Fly with me on Twitter] [Google+] [My broken website]

All glory be to the Man at the right hand... On David's throne the King will reign, and the Government will rest upon His shoulders. All the earth will see the salvation of God.                                                                                                                                                       [Need free cloud storage? I personally like DropBox]

Of Stranger Flames - [indie turn-based rpg set in a para-historical French colony] | Indie RPG development journal


#37 RoundPotato   Members   -  Reputation: 68

Like
0Likes
Like

Posted Today, 12:11 PM

Thanks everyone, and thank you Servant for the extra effort and patience, that really did help.

At this point I feel like enough information has been provided and re-reading your replies should clear any confusion that may arise.

I also apologise for the battalion of somewhat varied questions in one thread, but that's just the way my thinking works(making a hundred similar looking threads without actually knowing what I'm asking wouldn't work, not to mention the spamming).





PARTNERS