Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

why does firebug debugging sometimes work and sometimes not?

I want to debug a javascript file that is embedded in the HEAD element.

I navigate to the site, see the code, and make a breakpoint:

alt text
(source: deviantsart.com)

But when I click on Reload, the script disappears and it doesn't stop at the breakpoint:

alt text
(source: deviantsart.com)

Debugging was working earlier so I know it works in general. What do I have to do so that Firebug always debugs my script?

like image 698
Edward Tanguay Avatar asked Apr 29 '10 05:04

Edward Tanguay


2 Answers

I've noticed this behaviour before as well. It seems that it can happen if you refresh the page while the debugger is running (i.e. after you've hit your breakpoint and are stepping through code). This is far from conclusive, just something I've casually observed over time.

Also, I try to avoid having multiple tabs open with firebug active, as it seems to get confused.

Edit: just thought I'd add that I've seen this manifest itself in a few different ways:

  • the external script file does not appear at all in the scripts panel.

  • the external script file appears but firebug doesn't "see" it. You know this has happened because the line numbers beside the code where a breakpoint can be set won't be highlighted (used to be green but now appear to be just a darker shade than other lines). I've seen this happen with inline javascript on a HTML page (horrors!) as well.

  • the external script file is there, but you can only see a single screen full of code. Where "screen full" is the firebug panel viewport.
like image 106
mmacaulay Avatar answered Sep 21 '22 17:09

mmacaulay


shut down firefox and then restart. sometimes firebug gets confused. also make sure you have the latest version.

like image 32
Scott Evernden Avatar answered Sep 22 '22 17:09

Scott Evernden