Skip to content
Firebug extension for accessing closed-over variables from the command line (obsolete - now integrated into Firebug)
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
chrome/skin/classic
content
defaults/preferences
.gitignore
README.md
ant.properties
bootstrap.js
build.xml
chrome.manifest
install.rdf
license.txt

README.md

FireClosure

Download (Firefox 14 and upwards, with Firebug 1.10)

FireClosure is an experimental Firebug extension that allows you to access closed-over ("private") variables in JavaScript, without having to mess around with tedious breakpoints.

For instance, given the following code...

function A() {
    var priv = 0;
    this.getter = function() {
        return priv;
    };
    this.setter = function(x) {
        priv = x;
    };
}
a = new A;

... FireClosure makes getting the value of priv as easy as a.%priv.

You can also see the closures in various DOM views, under the subheading "(scoped variables)".

Caveats

  • Firefox often optimizes away closures or variables. For debugging, you can temporarily add some evals around the relevant places in the code to make this less of a problem (also makes your code less performant).
  • Some objects might have unexpected scopes. This is because non-function objects don't actually have scopes in the first place; the functionality is faked by using the first property with typeof === 'function' that appears on the object.

Building

To create the XPI, download Apache Ant and run ant in the project directory.

Something went wrong with that request. Please try again.