Parts of Firefox…coded in JavaScript? News to me…
So, maybe I’m about to state the obvious here, but believe it or not, parts of Mozilla Firefox are coded in JavaScript.
JavaScript? Powering Firefox? Holy smokes, I had absolutely no idea.
Let me back up for a minute.
There’s a very small possibility that I’m going to be working with Mozilla for Google Summer of Code this year, so I downloaded the Firefox code base to take a look at what their code looks like.
And it looks good. Really good. Clearly, the guys at Mozilla are pros.
So I was digging around in the source code, and in the folder mozilla/browser/base/content/browser.js, there is a JavaScript file that essentially details how Firefox behaves.
Look – here’s the function that handles when a new tab is opened in Firefox:
function BrowserOpenTab()
{
if (!gBrowser) {
// If there are no open browser windows, open a new one
window.openDialog("chrome://browser/content/", "_blank",
"chrome,all,dialog=no", "about:blank");
return;
}
gBrowser.loadOneTab("about:blank", null, null, null, false, false);
if (gURLBar)
gURLBar.focus();
}
JavaScript. My mind is starting to get blown here, and I’m getting excited by the possibilities – seeing as how I’ve grown quite comfortable with JavaScript over the years.
And it’s all thanks to the Mozilla framework, apparently. I’m only scratching the surface here, but I’m really interested in this, and I’ll post more as I learn it.







