The firebugx.js file (viewable at http://getfirebug.com/firebug/firebugx.js) is designed to detect the installation of Firebug by checking both !window.console and !console.firebug. However, this method does not account for the native console object in the IE developer tools, resulting in the overwrite of the IE console object.
For instance, if the firebugx.js code is included, any exceptions thrown in the IE console will not be displayed (they will simply be ignored).
function foo() {
try {
throw "exception!!!";
} catch (e) {
console.error(e);
}
}
Question: What is the best approach to handle the IE developer debugger? One option might be to comment out the firebugx.js check when debugging in IE. Are there other solutions that can be considered?
Reference:
firebugx.js
if (!window.console || !console.firebug) {
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() {}
}