14

I would like to be able to edit a variable after setting (and hitting) a breakpoint, or simply pausing execution, in either Firefox or Firefox Developer Edition.

It seems that it used to have this feature, but it was removed when the debugger was reimplemented.

There used to be a way to get the old debugger back, but I have tried this and it no longer works.

I will accept answers that recommend addons.

gcb
  • 5,442
  • 13
  • 62
  • 86
Aster
  • 335

2 Answers2

8

The way I do it is to simply type the new variable into the debug console with the new value. For example, I would type: myobj.myprop = newval;Enter. No different from writing javascript. As long as the variable you are trying to change is in scope at your break point (and not initialized with const), it should work fine.

0

Create a Watch Expression for the variable. When the breakpoint hits, double-click the variable in the watch expressions list to get an editable field. Type in an assignment statement, e.g., myVar=newValue. It works with or without a semicolon.

Toto
  • 19,304