3 ms·
[Disclaimer: I'm not an expert on developing browsers] It depends on what exactly you'd want to implement, since a (modern) browser is really a huge piece of so
by newscracker 10y ago
[Disclaimer: I'm not an expert on developing browsers] It depends on what exactly you'd want to implement, since a (modern) browser is really a huge piece of software with several aspects and components in it. Looking at it from one angle, you could split it into chrome (not Google Chrome, but the UI, like tab bar, bookmarks, menus, extensions management, etc.) and content (the rendering engine).
You'd most likely get bogged down if you start writing your own rendering engine (processing HTML, CSS and JS, and processing image formats, video and sound formats, even not including any plugins), unless it's a very limited scope toy browser that can handle some simple stuff. In this case, start with base HTML support, including handling incomplete tags and quirks like that have been carried over for decades (the amount of cruft in rendering engines for backward compatibility and handling undocumented but accepted quirks would itself take a long time to develop). Then try a little bit of CSS support. I'd assume JS support could be quite challenging since that moves out of the already challenging "paint the screen" part into an even more challenging part on interpreting code, running it, optimizing it, etc., which is a lot more complex when you consider there would be several JS files loaded on most websites.
Something a little more easier (only comparatively) would be developing the chrome around an existing rendering engine and seeing how to handle tabs, background loading, foreground loading, bookmarks, private/incognito browsing, etc., and if you feel adventurous enough, adopt a particular process or threading model for a multi-tab browser.
Another alternative here is to create a WebView application and see which parts you could improve. For example, Chrome on iOS and Firefox on iOS are just the chrome for the built-in rendering engine in iOS, but address many things like tabs, networking, incognito mode, bookmarks, sync and other features. You could try creating a similar one on iOS, latching on to the work done by FoxBrowser [1] or Firefox for iOS [2]. On Android, you could try building on top of Firefox for Android [3].
If you'd like to work on a web browser rendering engine that's a bit more closer to "from scratch", I'd recommend working with the Servo [4] team and seeing how you can help. It's a long drawn project that has already made huge strides, but you'd get an inside view of the complexity of developing a browser engine. What's more, you could also learn Rust while doing this. [5]
[1]: https://github.com/graetzer/Foxbrowser https://github.com/graetzer/Foxbrowser
[2]: https://github.com/mozilla/firefox-ios https://github.com/mozilla/firefox-ios
[3]: https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Simple_Firefox_for_Android_build https://developer.mozilla.org/en-US/docs/Mozilla/Developer_g...
[4]: https://servo.org/ https://servo.org/
[5]: https://www.rust-lang.org/ https://www.rust-lang.org/