DataTables / VisualEvent

Visually show Javascript events on a page
http://sprymedia.co.uk
1.04k stars 162 forks source link

Link to file:row on firebug #21

Open ZeeD opened 12 years ago

ZeeD commented 12 years ago

Hi

I don't know how it does, but if you use firebug and do a

console.log(function_name); 

you can see a clickable function definition (there isn't the body). If you click you go directly on the script tab at the exact file/row.

It would be assome if - when you use VE in conjunction with firebug - can do the same thing

DataTables commented 12 years ago

VisualEvent can do that in Webkit based browsers, where it is possible to determine where a particular function comes from. I've yet to find a way to do it in Firefox. In Webkit browsers VisualEvent will show the file name and line number for the function, although not a clickable link. That's a nice idea for an enhancement.

lingo commented 7 years ago

In Firefox, I can see that finding the line would be tricky, but perhaps by normalizing the function and the source files you could at least find the file where it originates.

Something like this applied both to source and to function (also removing the prototype as for webkit) seems to work to find origin file (if not line number).

function normalize(s) { return s.replace(/\s+/g, ' ').replace(/\n+/g, ' '); };