Graceful Degredation of Your Firebug-specific Code
January 27th, 2008
// code yanked from the Yahoo media player. Thanks, Yahoo. if (! ("console" in window) || !("firebug" in console)) { var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml", "group" , "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"]; window.console = {}; for (var i = 0; i < names.length; ++i) window.console[names[i]] = function() {}; }
Follow me on twitter: @paul_irish
Well, this code is provided by Firebug itself, see http://www.getfirebug.com/lite.html.
Eh….
Actually it's here:
http://www.getfirebug.com/firebug/firebugx.js
Eyal, you're right! Funny since, I've used that file plenty before.. though sometimes I catch some nasty IE bugs when I use it.
This code still uses "console" in window instead of just checking window.console so there might be a diff. Let me take a peek.
Thanks!
No worries