Sprocket - Experimental Multiplatform Browser Based on Content API
Several months ago, a simple question was raised to us: How can one build a web browser? This was an interesting question not a trivial one to be answered in one sentence. So, at the University of Szeged we started to work on this issue to come up with a handy answer. This is how Sprocket was born. However, let us start from the beginning.
You can start from several perspectives. The main question is whether you want to build a browser on top of any current rendering engine, or you want to build a completely new browser and every component from scratch. If you choose to build a totally new browser, check out this tutorial. For those who would like to follow the beaten path, open source communities have already provided several high quality browser engines: WebKit (Safari), Blink (Chromium), Gecko (Firefox), Servo (Mozilla’s experimental project). There are also several other popular "out-of-the-box" solutions: CEF, NW.js (previously node-webkit), Awesomium, OpenFin, QtWebEngine. Each of these are using their own UI, callbacks, and ecosystem to support different purposes.
We have chosen the Content module to show the way to build up a browser. It has a nice API and several good documentations since the Content module is part of the Chromium project. We have spent some time looking for an accurate tutorial which describes how the Content API can be used to build up a browser, but we noticed that no such detailed guide exists. So, we decided to fill the gap and start a project on this topic. The main goal was to build an experimental minimal browser and write a detailed tutorial about it, so that anyone could build his/her own unique browser or even embed it.
From the technical perspective, the Content module is responsible for rendering a webpage using a multi-process sandboxed browser. It supports HTML5 and GPU acceleration as well. If you would like to read further details, you can check this out. The source of the Content module can be found in Chromium’s source (src/content). The classes in the content/public folder can be inherited in order to implement the required specific behaviours.
Our experimental project is named Sprocket. It supports multiple platforms: ARM (Android, Linux), PC (Linux), and our main goal is that the project should be as minimal as possible compared to the existing implementations. In the project, code size is reduced to a minimum, and unnecessary requirements are dropped. Now, we are continuously extending Sprocket with well-documented new features. We have finished the following milestones:
Currently, we are working on tab support for the Android version. The following additional features are planned to be supported in the future, but we are open for any suggestions from the community:
Here are a few screenshots of Sprocket on different platforms:
If you are interested, you can check out our GitHub repository here. We are pleased to accept any contribution. You can also check out our more detailed documentation about the current state of our project.
In the future, we plan to create a series of documents in order to oversee and share our process and achievements, and we shall also provide detailed tutorials for the community about the implemented features.
On behalf of the Sprocket team,