Plugin Development - Javascript Console Knockout Variable

Hello everyone,

I'm updating my plugin and sometimes to troubleshoot some stuff I like to see my knockout variables values.

To see if I have a logic error on the screen or just the variables are not set correctly.

I can print those values on the console by clicking a button and doing a console.log, but is there a way to get my knockout view from the console and get the value of a variable from there?

(I'm pretty sure that there is, and I think I've done it before, but really can't remember, it's been a while since I played with this)

I tried using the knockout plugins for chrome but those didn't work.

Best regards,

Vitor Henrique

typically when I'm doing plugin development I set my config.yaml to not bundle the assets, that way the files are all served individually instead of all lumped together. Then from the developer console you can set break-points from the sources of your js file, to stop and take a peek, run self.my_observable() in developer console, etc.

Yeap, that is what I'm currently doing right now...

But it kind of sucks that "self" is only your view model inside of your functions (of course)...

If you just open the javascript console, "self" is the entire window, and it does have a OCTOPRINT_VIEWMODELS variable, but from there I could not get the knockout variables...

I'm just trying to see if there is a better way than the breakpoints....