gBrowser is a window-global instance of a component called tabbrowser
gBrowser is a pretty bad name for what it is. Could maybe be called gTabsManager or gBrowsersManager
, is similar to an
g is for global, a is for argument, m is for method, s is for static, k is for global constant, ALL_CAPS for global constant
Firefox used to not have tabs! At some point in its lineage, Firefox didn’t have tabs. It was one per window. gBrowser.
They kept the same name when adding tabs! I think this was to make it easier to support XUL add-ons that relied on touching gBrowser. The new gBrowser variable had the same interface as the old one but would forward calls to the currently selected .