Debugging auto.js

Permalink
Hi All,
SOmething I don't really know how to deal with is debugging the auto.js in blocks.

I am developing a block and I'm using Chrome and it's developer tools.
I can see and debug all the javascript I'm using except what's in auto.js.

How do I see it in Chrome developer tool? How come it doesn't show up?

Thanks for any light you might shed on this.

mnakalay
 
formigo replied on at Permalink Reply
formigo
auto.js is loaded in when the block is added or edited. You wouldn't see it if you were looking at a block's view (output) for example.

Are you trying to debug the view or the add/edit dialogs?
mnakalay replied on at Permalink Reply
mnakalay
Hi thanks for the answer.
I know auto.js applies to the add or edit form. I am in the process of creating an add-on that's why I need to be able to debug it.
Of course I use the debugger on the add/ edit form, I see everything else except the auto.js.
I put a few console.log() in my code to still get something to work on and it works, I see them in the console, but I can't use breakpoints or anything.

Any idea?
JohntheFish replied on at Permalink Reply
JohntheFish
Sometimes scripts that the Chrome debugger won't interact with can be debugged in Firefox, and vice-versa.

A trick I often use with console.log is
var debug_flag=true;
debug_flag && console && console.log(msg_or_object);


This enables me to keep plenty of logging throughout a complex script with a single flag to turn it off on released code and no risk of it breaking with browses that don't have a console.
mnakalay replied on at Permalink Reply
mnakalay
Hi John
Nice trick thanks.

I'll try with firefox see if it makes a difference
JohntheFish replied on at Permalink Best Answer Reply
JohntheFish
I just wrote it up in a bit more detail in a howto (awaiting approval, so this link is for future readers and not for now)

http://www.concrete5.org/documentation/how-tos/developers/some-tric...