From: Matt Kruse on
I'm trying to reverse-engineer a page (Facebook, in particular) and
figure out what happens when a certain link is clicked. For this
exercise, I only care about Firefox.

What is the best way to find out what happens when I click a link,
what function calls are fired, and on what elements they are attached
to as listeners?

I have Firebug, of course, but perhaps I don't know how to use it
correctly to find this info.

Thanks,

Matt Kruse
From: kangax on
On 5/26/10 2:09 PM, Matt Kruse wrote:
> I'm trying to reverse-engineer a page (Facebook, in particular) and
> figure out what happens when a certain link is clicked. For this
> exercise, I only care about Firefox.
>
> What is the best way to find out what happens when I click a link,
> what function calls are fired, and on what elements they are attached
> to as listeners?
>
> I have Firebug, of course, but perhaps I don't know how to use it
> correctly to find this info.

Start up Firefox 3.7 with Firebug 1.5+ and check newly added "Events"
panel. It should give you a list of listeners added to a particular element.

<http://www.softwareishard.com/blog/firebug/eventbug-alpha-released/>

It won't help much if they're using event delegation of course, but you
can always trace where the "top" listener is and go from there.

--
kangax
From: nick on
On May 26, 2:09 pm, Matt Kruse <m...(a)thekrusefamily.com> wrote:
> I'm trying to reverse-engineer a page (Facebook, in particular) and
> figure out what happens when a certain link is clicked. For this
> exercise, I only care about Firefox.

Give one of the dev builds of chromium a shot...

> What is the best way to find out what happens when I click a link,
> what function calls are fired, and on what elements they are attached
> to as listeners?

Open the debug console, click scripts tab (in chromium, don't remember
firebug equivalent), hit the pause button (looks like two vertical
lines), click the link.

> I have Firebug, of course, but perhaps I don't know how to use it
> correctly to find this info.

Try the developer tools in chrome, you'll never look back.