I have a Javascript application that relies on capturing keyboard events in a text box. By checking and debugging it on Firefox (14.x) with firebug (1.10.2), I noticed that my application behaves differently when I have breakpoints and the debugger is working.
I know how to detect Firebug, but I would like to know if it is possible to detect (with Javascript) when Firebug is really used for debugging?
Edit: here is an example on some random site
This site catches the key event in the input field, displays the character code and replaces the pressed key with a text representation (ie "enter" to enter the key) or in upper case (if there is a letter).
When I debug it using Chrome and put a breakpoint in the listener function, nothing happens when the breakpoint is reached (as expected), when I return to the script, the text prints as usual.
When I debug it from Firebug to Firefox: let's say that I previously pressed the letter "e" and the input panel contained the text "E". I turn on the breakpoint and press the letter "z". Firebug stops at a breakpoint, but the input panel now has the text "Ez" instead of "E". When I resume the script, this text is replaced with "Z", as expected.
I tried another Firefox debugger (Venkman 0.9.89) and the same thing happened. Therefore, I assume this is a Firefox problem, not a debugger problem. So the question may be more general, can it be detected when debugging Javascript code?
source share