Web Browsers

Web Browsers

Welcome to my blog about the structure of web browsers! Whether you're a web design veteran or just starting out, the structure of web browsers can be a tricky subject to wrap your head around. But don't worry – I'm here to make it fun and easy for you! Follow me for more blogs and I'll help you understand the essentials of web browser structure, like how different browsers communicate with websites and how they interact with the user. So grab your favorite beverage, get comfy, and let's get started on this journey into the world of web browsers!

The structure and components of a web browser

image1

User Interface

The user interface includes the address bar, buttons (e.g., Back, Forward, Refresh), menus, etc.

It includes every visible part of the web browser except the area in which the web page is displayed.

Browser Engine

Provides a high-level interface for querying and manipulating the rendering engine.

Acts as a middleman between the user interface and the rendering engine.

Communicates with the data storage component.

Rendering Engine

A core component of web browsers.

Its function is to create a visual representation of web content (e.g, a HTML or XML document) to be displayed on an output device.

The rendering of content happens according to the formatting rules specified.

Networking Component

The networking component is responsible for handling network communication, including:

  • HTTP requests
  • WebSocket API
  • WebRTC

It provides a platform-independent interface, behind which platform specific APIs are used.

Further information:

JavaScript Engine

The JavaScript engine is responsible for executing JavaScript code.

Major JavaScript engines:

UI Back-end

The UI back-end is responsible for drawing in the web browser.

It is used both for displaying user interface elements and the web page.

It provides a platform-independent interface, behind which platform specific APIs are used.

Data storage

Data storage is responsible for persisting data locally, it is used for:

  • HTTP cookies
  • HTTP caching
  • Indexed Database API (IndexedDB)
  • Web Storage API

Further information:

image

Major Rendering Engines

  • WebKit
  • Blink
  • Gecko
WebKit

Website: https://webkit.org/

image

Website: https://www.chromium.org/blink/

image

Gecko

Website: https://wiki.mozilla.org/Gecko:Home_Page

image

Major Desktop Browsers

  • Chromium, Google Chrome
  • Firefox
  • Opera
  • Safari
  • Microsoft Edge

image

Chromium

Website: https://www.chromium.org/Home/

image

Google Chrome

Website: https://www.google.com/chrome/

NOTE: Google Chrome is based on Chromium.

Chromium and Google Chrome

Differences between the two browsers:

  • Different logos.
  • They are equipped with a different set of audio and video codecs.
  • User data are stored in different directories.
  • Chromium: ~/.cache/chromium, ~/.config/chromium
  • Google Chrome: ~/.cache/google-chrome, ~/.config/google-chrome
  • Operating system distributions may modify the source code of Chromium, packaging also depends on the distribution.
  • See: The Difference between Google Chrome and Chromiumon Linux

image

Firefox

Website: https://www.mozilla.org/firefox/

  • Developer: Mozilla Project
  • License: Mozilla Public License 2.0 (see: about:license)
  • Written in: C, C++, JavaScript, Rust
  • Platform: Linux, macOS, Windows
  • Rendering engine: Gecko
  • JavaScript engine: SpiderMonkey
  • Technical information: about:support
  • Developer edition: Firefox Developer Edition

image

Opera

Website: https://www.opera.com/

image

Safari

Website: https://www.apple.com/safari/

image

Microsoft Edge

Website: https://www.microsoft.com/edge

image

Browser Add-ons

A browser add-on is a software module for customizing the appearance or behavior of a web browser.

  • Types of add-ons: extensions, language packs, themes, plugins

Browser Extensions

A browser extension is a browser add-on that alters the behavior of a web browser, i.e., adds new functionality or modifies existing functionality.

Headless Browsers

A headless browser is a web browser without a graphical user interface.

  • It can be controlled programmatically.

Possible applications:

  • Automated testing of web applications
  • Automating interaction with web pages
  • Taking screenshots of web pages
  • Web scraping

See: https://en.wikipedia.org/wiki/Headless_browser

The Chromium, Google Chrome, and Firefox browsers can run in headless mode.

Taking a screenshot with Google Chrome (output is written to the file screenshot.png):

google-chrome --headless --screenshot \
--window-size=1920,1080 https://www.w3.org/

Free and open source headless browsers:

See: HeadlessBrowsers https://github.com/dhamaniasad/HeadlessBrowsers

The about URI Scheme

The about URI scheme is widely used by Web browsers to designate access to their internal resources, such as settings, application information, or hidden built-in functionality (e.g., Easter eggs).

Example:

  • The about:blank URI references a blank page.

Some browsers map about URIs to their own equivalents replacing the scheme name (i.e., about) with their name (such as chrome, opera, or edge).

  • For example, Chromium and Google Chrome uses the URI chrome://about instead of about:about.
  • An exception is about:blank, that is left unchanged.
Browser support:

Chromium, Google Chrome:

Firefox:

  • The list of about URIs: about:about
    • Examples: about:cache, about:downloads, about:mozilla, ...

Opera: Supports a subset of chrome URIs and a few additional ones, but the scheme name is replaced with opera.

Safari: Only about:blank is recognized.

Chromium-based Edge:

Conclusion

Well there you have it, the structure of web browsers is a complex but fascinating topic. Now that you know a bit more about the inner workings of browsers, why not follow me for more laughs and laughs about web browsers? That way, you'll be in the know about all the latest developments and news in the world of web browsers. See you next time!

Did you find this article valuable?

Support Mojtaba Maleki by becoming a sponsor. Any amount is appreciated!