I am trying to debug a web page in FireFox v42.0 Windows 10, where that web page goes through a proxy server and has code injected into it inline via <script>...</script>
(not including a separate .js file) by the proxy server. When I right-click View Page Source, I see the original page plus the code I expect to see injected (and which is actually running). I also see the injected content in the DOM view of the Inspector tab. And it is also visible in the Network Tab in the Response section. However, when I view the same page in the debugger, the injected code is not visible, as if the page were not running through the proxy server.
Furthermore, if I insert a debugger;
statement in the injected code, I do hit the breakpoint, but in the FireFox debugger tab it tells me I'm on line 550 of a file with only 173 lines in it according to FireFox. So I can not step through the code.
When I do the same thing in Chrome, I see what I'm expecting, which is the injected code in my page, and I am able to debug this code without problem.
I have cleared my cache to no effect. I looked at the Network tab and everything looks as expected there.
How and why is FireFox not showing me the actual page in the debugger tab (matching what's in View Source or the DOM view), and not letting my step through the injected code?
There are three ways to open the debugger: Select the Debugger panel in the Web Developer Tools, accessible from the Browser Tools submenu. Press Ctrl + Shift + Z on Windows and Linux, or Cmd + Opt + Z on macOS (starting in Firefox 71; prior to Firefox 66, the letter in this shortcut was S ). Press the menu button.
You can set an unconditional breakpoint using the context menu (see above), or by: Clicking on the line number for the line you want to break at in the source pane. Highlighting the line you want to break at in the source pane and pressing Ctrl + B (Windows/Linux) or Cmd + B (macOS).
To activate View Source: context-click in the page and select View Page Source. press Ctrl + U on Windows and Linux, or Cmd + U on macOS.
The below worked for me
There are a few bugs in Firefox that can cause this that I've encountered myself:
If this is happening to you try debugging in the default/no container, or just do it in Chrome 🙁. If you can't debug in another browser, at least try a fresh profile before you "refresh" (nuke) Firefox as others suggest. You can do this from the about:profiles
page (address must be typed manually or bookmarked), or by opening Firefox with the -P
flag and creating a new one. To use those flags, run firefox -P --no-remote
from a *nix/Mac terminal or C:\Program Files\Firefox Developer Edition\firefox.exe -P --no-remote
from the Windows Run dialogue; the --no-remote
flag is not required but allows you to run the new profile alongside your main one, and disregard links clicked in other programs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With