rem: dump("No browser found!\n"); 
add: if(topContentWindow && topContentWindow.document && topContentWindow.document.location) dump("No browser found: "+topContentWindow.document.location+"\n"); else dump("No browser found!\n");  
context: function ContentWindowMapper() {    this.cache = new Object();    this.cache["bah"] = 0;    this.checkCache = function(topContentWindow) {        if(typeof(this.cache[topContentWindow]) != "undefined") {            dump("Found cached element\n");            return this.cache[topContentWindow].browser;        }        return null;    };    this.addCache = function(topContentWindow, browser) {        var insertion = new Object();        insertion.browser = browser;        insertion.time = Date.now();        this.cache[topContentWindow] = insertion;         dump("Cached element\n");    };    this.expireOldCache = function() {        var now = Date.now();        for(var elem in this.cache) {            if((now - this.cache[elem].time) > EXPIRATION_TIME) {                dump("Deleting expired entry\n");                delete this.cache[elem];            }        }    };    this.getBrowserForContentWindow = function(topContentWindow) {        var cached = this.checkCache(topContentWindow);        if(cached != null) return cached;        var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]            .getService(Components.interfaces.nsIWindowMediator);        var enumerator = wm.getEnumerator("navigator:browser");        while(enumerator.hasMoreElements()) {            var win = enumerator.getNext();            var browser = win.getBrowser();             for (var i = 0; i < browser.browsers.length; ++i) {                var b = browser.browsers[i];                if (b && b.contentWindow == topContentWindow) {                    this.addCache(topContentWindow, browser);                    return browser;                }            }        }        dump("No browser found!\n");        return null;    };  // This JSObject is exported directly to chrome  this.wrappedJSObject = this;}
meta: 3444	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/3444/e5a0a16dd95e7891db8d43fa3d65de52ffe89f83/window-mapper.js/clean/src/components/window-mapper.js