Zhasulan Berdibekov
Zhasulan Berdibekov

Reputation: 1087

javascript determine of firebug

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

Answers (2)

Ege Özcan
Ege Özcan

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

darioo
darioo

Reputation: 47183

Two steps:

  1. 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.

  2. 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

Related Questions