News for hackers. Stuff that matters.
Re:Chrome’s Console API: Greatest Hits by tajen on Friday April 03, 2015 @04:17AM (#9314880)
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.

Re:Chrome’s Console API: Greatest Hits by Encosia on Friday April 03, 2015 @09:02AM (#9315595)
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
Re:Chrome’s Console API: Greatest Hits by deanclatworthy on Friday April 03, 2015 @05:55AM (#9315109)
The simple solution is to polyfill: https://github.com/paulmillr/console-polyfill
Re:Chrome’s Console API: Greatest Hits by ux-app on Friday April 03, 2015 @07:49AM (#9315330)
Another solution is to remove all debug commands as part of your build/deploy process.
Re:Chrome’s Console API: Greatest Hits by rmchugh on Friday April 03, 2015 @05:56AM (#9315110)
too right, extremely annoying bug, because when you open the dev tools to debug it, it starts working again!
Re:Chrome’s Console API: Greatest Hits by cleverjake on Friday April 03, 2015 @04:22AM (#9314891)
that hasn't been the case since IE 9
Re:Chrome’s Console API: Greatest Hits by tajen on Friday April 03, 2015 @04:27AM (#9314906)
This person is reporting it for IE10, do you have more insights? Do you think his IE was in compatibility mode? http://stackoverflow.com/questions/18480948/ie-10-debug-cons...
Re:Chrome’s Console API: Greatest Hits by cleverjake on Saturday April 04, 2015 @02:38AM (#9320180)
yep. compat mode.
Re:Chrome’s Console API: Greatest Hits by ahoge on Friday April 03, 2015 @08:59AM (#9315585)
> Don't use that in prod

A linter will catch this.