Reputation: 1087
I want to ask people to disable firebug. How to determine that they have installed firebug? And so it was a cross-browser and determined in Chrome, Mozilla and IE8 +
Upvotes: 2
Views: 208
Reputation: 14269
easy:
if(window.console && window.console.firebug) alert("I caught a firebug");
edit: I don't see any reason to ask people disable it, unless you have a strong performance issue like gmail.
edit2: I've read your question again. If you also want to check for firefly and chrome console, just check for window.console
important edit3: firebug 1.9 doesn't add window.console.firebug anymore. don't know since which version this is the case.
Upvotes: 4
Reputation: 47183
Two steps:
if window.console
exists, then Firebug might be installed. This might not be true, since window.console
might also indicate that Chrome's console is enabled.
if step 1. returns an object, check if console.firebug
returns anything. If it does, it will be Firebug's version number.
Now you know how to see if Firebug is installed, but you can't force your user do disable it. Try logging in to Gmail with Firebug enabled and they show you a warning that having it enabled might lead to performance issues.
Upvotes: 4