Hiding browser chrome

There are times in which an extension may find it useful to hide browser chrome (that is, toolbars, the location bar, and so forth), in order to reduce clutter when presenting a particular user interface. This is done, for example, by the about:addons page.

This works by saving a reference to the current implementation of the hideChromeForLocation() method, then replacing it with a new method that calls through to the previous implementation. By chaining multiple implementations of the method together in this way, everyone that wants to hide chrome can do so when appropriate.