Blog

Rethinking Web Browsers: A Case for a Unix-Like Approach

This blog post explores the concept of a Unix-like web browser that offers greater transparency, flexibility, and control for users, advocating for a system that manages browser processes similarly to an operating system.

  ·   6 min read

Web browsers today function as essential tools but often lack the transparency and control found in Unix-like operating systems. This blog post explores the idea of a Unix-like browser that provides users with greater flexibility and the ability to monitor, configure, and manage browser processes more effectively.

What is a Browser

You are likely familiar with what a web browser is. If not, I recommend you pause reading this blog and educate yourself about web browsers, as it is crucial knowledge.

For those still with me, you already understand the basics of a web browser. Nonetheless, I will provide a brief overview from my perspective.

A web browser functions similarly to an operating system within an operating system. It is a program that loads, runs, and manages other programs, namely websites. It serves as an intermediary between the website and the underlying operating system, just as the operating system mediates between programs and the hardware.

The web browser manages memory, handles file system calls, performs graphics rendering, and fulfills all the needs of a program. Although the programs in this case are websites, they require the same resources and exhibit similar behaviors to desktop programs, with only a few differences.

When I consider a web browser, I view it as a type of operating system—a highly abstract one, but an operating system nonetheless. Consequently, I expect it to operate like an operating system. In terms of operating systems, I respect only those that adhere to the Unix philosophy, as it has proven itself over decades to be the only philosophy that works, scales, and behaves well.

The Unix Philosophy

The Unix philosophy establishes several fundamental principles that every program should follow. Among these is the idea that each program should “do one thing well.” This principle lays the groundwork for another key tenet: “expect the output of every program to become the input to another.” These principles advocate for breaking down complex tasks into many small, specialized parts, each performing one task efficiently. Additionally, each part should produce output that can serve as input for another part.

The Unix philosophy also asserts that everything should be treated as a file. This approach promotes a standardized and clean structure for the file system, facilitating interaction between the user and the machine through structured files.

There are many more principles within the Unix philosophy. After more than a decade of using Unix-like operating systems, these principles have become so ingrained in my daily workflow that they no longer seem like distinct fundamentals but rather natural and essential aspects of system design.

Existing Browsers

Web browsers function similarly to operating systems. They manage multiple processes(websites) and assist both developers and users in developing, maintaining, monitoring, and upgrading these websites, much like a real operating system does.

In today’s world, numerous web browsers are available, but many share the same underlying engine. My primary focus is on these engines, which is why I categorize all Chromium-based browsers, such as Opera, Brave, Edge, and Google Chrome, under the “Chromium” browser.

Currently, we have several major browser engines in use:

  • Chromium: The engine powering most of the web browsers today.
  • Mozilla Firefox: Utilizes the Gecko engine.
  • Safari: Uses the WebKit engine.
  • Additionally, there are a few other browsers that utilize different, less common engines.

No Browser Follows the Unix Philosophy

None of the existing browsers are designed to function like an operating system from the user’s perspective. While their internals might operate similarly to an operating system, with components for memory, disk, and graphics management, they present themselves to users as black boxes with very limited flexibility—unless you are a browser or extension developer.

Unlike a Unix-like system, these browsers lack concepts like procfs that allow any user with filesystem skills to explore what is truly running inside the browser. They do not provide configuration options via a simple /etc like directory structure. Instead, they function as large, monolithic systems with their own APIs and protocols, limiting user control and transparency.

The Ideal Browser

A browser doesn’t have to be a black box; it can function like a Unix-like operating system, providing transparency and flexibility. Imagine a browser that:

  • Exposes its internal state via something like procfs: This would allow users to explore and understand what is running inside the browser.
  • Relies on configuration files like /etc: This would enable users to configure the system easily, using familiar structures and tools.
  • Manages plugins like programs via a package manager: This approach would standardize plugin management, allowing for the development of various package managers.

Managing multiple browser profiles is like dealing with a “dual boot” system. Each profile manages its data within a root directory with various subdirectories. But only the browser and extension developers understand the structure of these profile directories. Why not standardize this structure? By adopting a regular Unix-like system approach with standard configuration files under the /etc directory, we could develop generic desktop programs to fine-tune and customize browsers to individual needs.

In my opinion, the browser should function like a container manager (e.g., Docker, containerd). It should manage each website in its own Linux namespace, exposing its procfs to the file system under the root folder (the profile folder). This would bring the power and flexibility of Unix-like systems to web browsers, creating an environment where users have more control and transparency.

Conclusion

Developing a web browser is a complex task, and I personally do not have the ability or time to undertake it. However, I believe that the need for a Unix-like browser is essential. Without such a browser, we will continue to experience browsers consuming excessive RAM and CPU without a clear explanation.

Perhaps the Chromium browser could serve as a base to wrap with a Unix-like user interface. I am not certain and do not claim to be a browser expert. I am merely thinking aloud in this blog post. As a user, I wish I had the ability to monitor, explore, and fine-tune my browser more effectively.

I have used many major browsers over long periods, including Firefox, Google Chrome, Chromium, Opera, and Brave. None of them have provided what I want or need. Currently, I am using Brave, which, unfortunately, is just another browser with the same limitations as the rest.

Imagination Part

Imagine a world where you can:

  • Store your browser profile in a GitHub repository, sharing it seamlessly between computers.
  • Run ps to get a list of running tabs and the resources (CPU/RAM) they consume.
  • Explore the file system and run diff to understand recent changes made by an extension.
  • Configure your web browser using simple text-based configuration files.
  • Use a real package manager for browser extensions.
  • Limit the resources of the browser or specific websites via a simple configuration file.
  • Avoid relying on extensions developed for specific browsers and versions.
  • Share your browser configuration with friends, family and the world.
  • Explore website cookies and internal storage just like other files on your disk.
  • Monitor the network traffic of a website just like any other process on your system.

All this is already possible if you are a browser guru of a specific engine. But I don’t want to be a guru; I just want simple things to be simple.