Skip to content

Commit

Permalink
[eventbug] Display also event handler for the window (and iframes).
Browse files Browse the repository at this point in the history
  • Loading branch information
janodvarko committed May 17, 2011
1 parent 5ebc52d commit 79a8a68
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion chrome/content/eventbug.js
Expand Up @@ -189,6 +189,8 @@ EventPanel.prototype = extend(Firebug.Panel,

var node = elt;
var eventInfos = {};

// Iterate all elements on the page.
for (; node; node = walker.nextNode())
{
if (unwrapObject(node).firebugIgnore)
Expand All @@ -206,6 +208,26 @@ EventPanel.prototype = extend(Firebug.Panel,
eventInfos[info.type] = [entry]; // one handler of this type
});
}

// Iterate all window objects (iframes) on the page.
for (var i=0; i<this.context.windows.length; i++)
{
var win = this.context.windows[i];
FBTrace.sysout("getBoundEventInfos ", win);

this.appendEventInfos(win, function buildEventInfos(elt, info)
{
if (!showNative && info.inSystemEventGroup)
return;

var entry = new BoundEventListenerInfo(elt, info);
if (eventInfos.hasOwnProperty(info.type))
eventInfos[info.type].push(entry);
else
eventInfos[info.type] = [entry]; // one handler of this type
});
}

return eventInfos;
},

Expand Down Expand Up @@ -604,7 +626,7 @@ var EventListenerInfoRep = domplate(Firebug.Rep,

var start = fnAsString.indexOf('{');
var end = fnAsString.lastIndexOf('}') + 1;
var fncName = cropString(fnAsString.substring(start, end), 20);
var fncName = cropString(fnAsString.substring(start, end), 40);
if (FBTrace.DBG_EVENTS)
FBTrace.sysout("events.getHandlerSummary " + fncName + ", " + listener.type, listener);

Expand Down

0 comments on commit 79a8a68

Please sign in to comment.