Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to log the JavaScript stack trace without putting breakpoints?

I would like to be able to perform manipulations on a given JS app, and then simply get a large log of all the functions that have been called. This is possible in Chrome, but only if one puts a breakpoint somewhere. My problem is when I am reverse-engineering a given website (only for self-teaching purposes, of course) it often takes me a whole lot of time to figure out where to even start from. Something like that will help me tremendously because I will no longer have to search within the code, rather, I will just do a user action, and grab the stack log afterwards.

I suppose that there should be a way to intercept (or wrap) every function call, so that it is dumped to the log before the function is called.

like image 969
user802232 Avatar asked Sep 17 '11 11:09

user802232


People also ask

How can I check my browser stack trace?

You can easily see the stack trace in JavaScript by adding the following into your code: console. trace(); And you'll get an outputted stack trace.

Can you debug JavaScript?

But fortunately, all modern browsers have a built-in JavaScript debugger. Built-in debuggers can be turned on and off, forcing errors to be reported to the user. With a debugger, you can also set breakpoints (places where code execution can be stopped), and examine variables while the code is executing.


1 Answers

Try this article: http://eriwen.com/javascript/stacktrace-update/ or this post: http://ivan-ghandhi.livejournal.com/942493.html

and, probably, this: How can I get a Javascript stack trace when I throw an exception?

like image 157
c69 Avatar answered Sep 24 '22 22:09

c69