top | item 9314759

(no title)

soyuka | 11 years ago

The console api isn't really linked to chrome. I prefer the chrome debugging tool but those things should work on firefox too. I think you could be clearer on this point.

discuss

order

tajen|11 years ago

Don't use that in prod, because it doesn't work in IE and it will cause your js to stop working.

In IE the 'console' object doesn't even exist if the developer tools aren't displayed, so if you use "console.log" in your program, your js will just throw an NPE.

Note that if you try closing the Developer Tools, 'console' is still declared for this page and all descendant pages. To test 'console.log' you need to avoid opening the devtools and open a new tabs.

Encosia|11 years ago

I don't remember when exactly, but they fixed that at some point. I just ran this simple test in IE (without ever opening the dev tools) and got the alert: http://jsbin.com/hodavocuwu/1/edit

rmchugh|11 years ago

too right, extremely annoying bug, because when you open the dev tools to debug it, it starts working again!

cleverjake|11 years ago

that hasn't been the case since IE 9

ahoge|11 years ago

> Don't use that in prod

A linter will catch this.

ndesaulniers|11 years ago

Indeed, all of these are in Firefox, in Nightly at least. Though console.profile and console.profileEnd didn't seem to work? I'm sure someone from FF dev tools will turn up in this thread to clarify.

jsantell|11 years ago

time/timeEnd, profile/profileEnd all work in Firefox up to Aurora -- current nightly has a new performance tool that will support profile/profileEnd in a few days, and will most definitely have it before uplift to Aurora https://bugzil.la/1077464