debug.js
debug.js copied to clipboard
JS Debugger with breakpoints
Is it possible to make a javascript debugger as in Developer Tools where you can add breakpoint and view all variables values?
I think this can be done with proxy server which will insert code like dbg.breakpoint(); before lines where user clicked to add breakpoint.
It seems difficult to implement it directly in the form of breakpoints, but you can do something similar.
The debug.js has a function "log.p()" which can show the variable values. Prepare a function yourself for debugging like:
function breakpoint() {
log.p(SOME_VALIABLE_YOU_WANT_TO_VIEW_1);
log.p(SOME_VALIABLE_YOU_WANT_TO_VIEW_2);
log.p(SOME_VALIABLE_YOU_WANT_TO_VIEW_3);
}
and then insert the function before lines where you want to debug.