Web - Browser

About

A browser is a user agent.

Components

Browser

The figure shows some of the components you will find in a browser. To the left, there is the user interface. The browser needs a rendering engine to display pages, and to interpret user input such as mouse clicks somewhere on the displayed page. There is a layout engine which computes how an HTML page should be displayed, including cascading style sheets and images. A JavaScript interpreter runs JavaScript code embedded in or referenced from HTML pages. Events from the user interface are passed to the JavaScript interpreter for processing. On the top, there are interfaces for plugins that can handle Applets, embedded media objects like PDF files, Quicktime movies and Flash animations, or ActiveX controls that can do anything.

In the center of the figure you can find internal components. Browsers have a cache of recently accessed documents and image files. They need to remember cookies and passwords entered by the user. Such information can be kept in memory or stored persistently in the file system at the bottom of the figure, to be available again when the browser is restarted. Certificates for secure communication are almost always stored persistently. To the right of the figure is the network. Browsers support many protocols on different levels of abstraction. There are application protocols such as FTP and HTTP to retrieve documents from servers, and transport layer protocols such as TLS/SSL and Socks to establish connections for the application protocols.

One characteristic of browsers that is not shown in the figure is tolerance for bad input. There needs to be tolerance for invalid user input to make the browser user friendly. There also needs to be tolerance for malformed documents retrieved from servers, and for flaws in server behavior when executing protocols, to make as many websites as possible accessible to the user.

Cache

see Browser Cache - Management and usage

Browser as thin-client

A browser is sometimes called:

Thin clients usually do not do things like:

  • query databases,
  • execute complex business rules,
  • or connect to legacy applications.

When you use a thin client, heavyweight operations like these are off-loaded to the server.

Browsers Virtualization

Xenocode is offering a software virtualization engine and on their homepage they made several browsers such as Firefox, Chrome, IE and Safari available as a single .exe file. This allows you to run any of these browsers without the need to install/uninstall. Just start the .exe and enter the URL.

Performance

You can improve the performance of a browser by caching small, frequently used static files such as .javascript, .gif, and .css files.

By enabling caching and content expiration on the Web server, Web browsers can determine how often to reload the static files from the server.

Security

security Security in the Browser

Management

Id

user agent string

List

Full list at Browser Capabilities Project (browscap or BCP)

Well-known:

Library:

if (Desktop.isDesktopSupported()) {
   Desktop.getDesktop().browse(file.toURI());
} else {
   throw new UnsupportedOperationException("Browser not supported.");
}

Detection

Feature

See Browser Capabilities Project (browscap or BCP)

Library / API / Automation

Default

Windows

reg query "HKCU\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http" -s
HKEY_CURRENT_USER\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice
    Hash    REG_SZ    GlByFBTjFZc=
    ProgId    REG_SZ    ChromeHTML

where:

  • ChromeHTML is the output of ftype. See DOS - File

Example:

ftype ChromeHTML
ChromeHTML="C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" -- "%1"

Documentation / Reference

Task Runner