5

Say I set a break-point on a line of code in Firefox devtools/Debugger and refresh the webpage to stop at that line. Can I skip the execution of that line and jump directly to the next line?

2
  • @Yogi no, "step over" will execute the current line and stop at the next line. What I want is to skip executing the current line and continue from the next line. Commented Jun 12, 2022 at 7:22
  • 1
    Could you please elaborate on why you want to skip a line while debugging? Maybe also provide an example to make it clearer for people to understand the question. Commented Jun 12, 2022 at 22:52

1 Answer 1

1

No, it's currently not possible (as of Firefox 101) to skip lines when debugging.

What you may do is manipulate the code while you're debugging. E.g. you can reset the value of a variable when it gets a new value assigned while the execution is stopped at a breakpoint. Or when the next statement is a function call, you can replace that function by an empty one. Of course, it is not always possible to turn a statement into a no-op. And doing so may have side effects.

Sign up to request clarification or add additional context in comments.

2 Comments

The problem is the statement I want to skip is "window.location='newwebpage.com';". If I cannot skip this line, I have no chance to debug the following code as 'newwebpage.com' will replace the current web page. I heard of old Firebug or Chrome seem to have live-editing function that I can edit(remove) the source code on the fly, but I cannot find similar function in Firefox.
I see. You should mention that in your question. Though generally you should avoid executing code after window.location because it's not guaranteed to be executed before the page context changes, i.e. the window.location assignment should be the last statement in your code path. But you're right, the Chrome DevTools allow you to change the code on-the-fly. Firebug didn't have that as far as I remember. (And I am one of the former contributors to it. :) ) The Firefox DevTools are missing this feature so far. See bugzil.la/771339.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.