Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

See/Log which javascript function is being executed by the browser

Is there a way/add-on that I can use so everytime any javascript function is executed in Firefox for example, the function name will be printed (to the console or where ever).

This is because I can't find (it's very hard to find) which function is executed when I click on a drop down.

So i want firefox/add-on to tell me the name of every javascript function that is being executed.

like image 941
Lydon Ch Avatar asked Aug 10 '11 08:08

Lydon Ch


People also ask

How do you check if a function is executed in JavaScript?

You can drop the == true since they both return booleans. If this condition if (function1() && function2() ){ is true, it means that these functions was executed and returned true. just be aware of that if the first function doesn't return true or the second won't be executed.

How do I find what JavaScript is running on certain events?

Under Chrome's Elements view, try Inspect-ing an element (right-click, Inspect); then, on the right side of the developer view, scroll down to Event Listeners. Here you can view what code files have hooked up an event.

How a JavaScript program is executed by the browser?

The program is executed from a binary format, which was generated from the original program source code. JavaScript is a lightweight interpreted programming language. The web browser receives the JavaScript code in its original text form and runs the script from that.

Can you console log a function?

We can call any function inside a function, including console. log().


1 Answers

You can use the profiler of Firebug.

Go to the console tab and click Profile. The profiler starts and all the javascript actions are "logged" till you click Profile again. Then you get the list of javascript functions that were executed in this interval.

A similar feature is available in most modern browsers' consoles.

like image 156
Nivas Avatar answered Nov 11 '22 05:11

Nivas