View JavaScript variable values in real-time?

Greetings!

First:
My apologies if this has been asked a zillion times before. I have diligently searched the web - and these fora - and have not found an answer.

Question:
Is there a way to view/watch a JavaScript variable’s value in real-time?

Discussion:
All the research I have done so far returns the answer “No”. The development tools allow you to stop execution at particular points and then view the values and status of a whole host of things.

This is useful when the browser interaction is relatively static - click on something and something else happens, or type something in and it gets sent to the page.

My case involves a fluidly interactive application - controlling a remote device with a joystick. In my use-case, the values are primarily of interest while they’re changing - are they changing smoothly? What values are they constrained to?

Reading the static value of a particular button or joystick is pointless - it’s only interesting when they’re changing and knowing the rate of change, the smoothness of change, etc., is essential.

Now that the browser is becoming more interactive - games, immersive 3D, etc. - the ability to monitor a value as it is dynamically changing can be critical.

Is this possible? If so, how?

If this is NOT possible, would you folks please consider this for a future release, ASAP?

Thanks!

Jim “JR”

Hi @jharris1993,

I love the use cases of games and 3d spaces for monitoring state and input.

Chrome offers Live Expressions; which will execute a given expression repeatedly and provide the output. Have you tried those?

Inspired by this and trying to fit it in with existing tools, we actually have a contributor working on Live Watch Expressions. Debugger’s watch expressions right now only work when paused; and this would make them sample variable values even outside of paused state. Have you used Watchpoints before?

1 Like

Greetings!

I hope this finds everyone safe and well.

I have been away for a while, but am now returning to this project.

Re: Chrome
Chrome’s joystick handling is a bit more complicated than Firefox’s joystick methods so, if possible, I’d like to do, at least the initial development, in Firefox.

Has there been any progress with Live Watch Expressions, or something similar? I’d REALLY like to be able to pick an expression or a particular variable, and watch what it’s doing.

Thanks!

This is also requested in https://bugzilla.mozilla.org/show_bug.cgi?id=1578789. So you may want to follow that feature request.

Sebastian