In chrome, you can try using the debug keyword.
function debug(fn) { [Command Line API] }
For example, paste this code into the Chrome Developer Console:
function hw() { alert('hello world'); } debug (hw); hw();
It will create a virtual file and start at the breakpoint in your function.
source share