title: Setting breakpoints dynamically at runtime in Javascript
body: <p>Both firebug and the built in console in webkit browsers make it possible to set breakpoints in running Javascript code, so you can debug it as you would with any other language.</p>
  
  <p>What I'm wondering is if there is any way that I can instruct firebug or webkit that I'd like to set a breakpoint on line X in file Y at runtime, and to be able to examine variables in the specific scope that I have paused in.</p>
  
  <p>I need something that can work in both Chrome (or any other webkit browser) and Firefox. For the latter Firebug is an acceptable dependency. Supporting IE is not a requirement.</p>
  
  <p>I've been building an in-browser IDE ( quick video for the interested: <a href="http://www.youtube.com/watch?v=c5lGwqi8L_g" rel="nofollow">http://www.youtube.com/watch?v=c5lGwqi8L_g</a> ) and want to give it a bit more meat.</p>
  
  <p>One thing I did try was just adding <code>debugger;</code> as an extra line where users set them, but this isn't really an ideal solution.</p>