667
edits
Changes
→8. Submission
* Learn how to run individual tests in a big project
* Fix a bug in big code
* Read parallel implementations in other large open source projects (Firefox, Chrome)
* Read and Write code written in modern JavaScript
Sometimes it's helpful to compare how two different projects implement the same feature. You can often learn a lot by reading the code in a project that does what you want, in order to make another do new things.
We'll compare the code for Firefox , Chrome, and Brave:
* The code for fixing URL bar input in Brave is written in JavaScript, see https://github.com/brave/browser-laptop/blob/master/js/lib/urlutil.js
* The equivalent code in Firefox is written in C++, see https://searchfox.org/mozilla-central/source/docshell/base/nsDefaultURIFixup.cpp
* The equivalent code in Chrome is also written in C++, see https://cs.chromium.org/chromium/src/components/url_formatter/url_fixer_unittest.cc and https://cs.chromium.org/chromium/src/components/url_formatter/url_fixer.h
Read through both files and try to orient yourself. Don't get hung-up on understanding every single line, especially in the Firefox code, which uses lots of internal APIs and [https://en.wikipedia.org/wiki/XPCOM XPCOM base code]. Instead, try to find clues as to how each one is doing what it does with input strings before converting them to URLs.
* Did you notice any other interesting differences between browsers and how they handle strings in the URL bar?
* How did you write tests for these cases?
* What did you notice in the Firefox /Chrome code that was both similar and different to the Brave URL handling code?
* What did you have to do in order to get Brave to work the same as other browsers?
* What did you need to learn in order to complete the work?