When Firebug is not enabled, I have some Firebug console function calls that I wanted to disable by checking if the console object is defined. This implementation works in IE6 and FF3, but unfortunately not in Chrome:
var log;
if(console){
log = console.log;
}else{
log = function(){ return; }
}
However, in Chrome, I encounter an "Uncaught TypeError: Illegal Invocation" error =/
I came across a discussion about this issue here, where it was mentioned that applying a context is necessary, which is something new to me... I am struggling to find a way to achieve the desired functionality in all browsers...