It didn't work here. (
Ubuntu 8.04 i.e. Hardy Heron
FireFox 3. 0.3(a.t.m.)
FireBug installed from the Ubuntu repostiories
)
So I fiddled somewhat:
if (window.console){
for (index in window.console){
console.log(index + ' >' + window.console[index]);
}
}
This gives me everything of window.console if I am not mistaken.
Long story short, no window.console.firebug || console.firebug
.
So I decided to do a check for something else, namely firebugVersion()
.
Which give me this script:
if (!window.console || !window.console.firebugVersion)
{
var names = ["log", "debug", "info", "warn", "error",
"assert", "dir", "dirxml", "group", "groupEnd", "time", "timeEnd",
"count", "trace", "profile", "profileEnd"];
window.console = {};
for (i in names)
{
window.console[names[i]] = function() {};
}
}
This works for me,
not giving me errors in Opera
and giving me console-stuff in firefox.
On Aug 11, 6:43 am, John J Barton <
johnjbar...@johnjbarton.com> wrote:
> window.console is available 1)IfFirebugisactive, 2)Ifthe Console
> isactive, and 3)ifthe window getter function has run. You might
> need something likeif(window.console && window.console.firebug) I don't know.
>
> On Aug 10, 3:09 pm, duniyadnd <
umangb...@gmail.com> wrote:
>
> > Sorry, I replied before your message even showed up on my end - so it
> > had nothing to do with your message. I initially had
>
> >if ( window.console.firebug> 0 ) {/* xyz */}
>
> > and it didn't work since Firefox 3, so I figured it had to match the
> > first character of the string.
>
> > On Aug 8, 11:36 am, John J Barton <
johnjbar...@johnjbarton.com> wrote:
>
> > > I don't understand what you are saying. What does not work and what
> > > does the numerical interpretation of the string "1.2b7" have to do
> > > with detectingFirebug?
>
> > > On Aug 7, 12:18 pm, duniyadnd <
umangb...@gmail.com> wrote:
>
> > > > It doesn't work because it is no longer a whole number (e.g. 1.2b7)
>
> > > > <script>
> > > > var fire = String(window.console.firebug);
> > > >if( fire.substr(0,1) > 0 ) {
> > > > // found you} else {
> > > > // carry on
> > > > }
>
> > > > </script>
>
> > > > On Aug 7, 11:06 am, BigKat <
aaronsah...@yahoo.com> wrote:
>
> > > > > I agree and I would like not to be able to show this message and have
> > > > > my application work
> > > > > the same whenfirebugis enabled as it is when disabled. But for the
> > > > > time being I really need to
> > > > > put up a warning message.
>
> > > > > So can you please let me know how I candetectifthe console is
> > > > > enabled in FireFox 3? Once I at least have
> > > > > that check in there I plan on digging into what the real issue is.
>
> > > > > Thanks.
>
> > > > > On Aug 6, 11:29 pm, John J Barton <
johnjbar...@johnjbarton.com> wrote:
>
> > > > > > I think your better strategy is help us fix the undesired behavior.If
> > > > > > the user has the console enabled, you candetectit, but I doubt that
> > > > > > has anything to do with your problems. More like it is script or net,
> > > > > > which you can'tdetect.
>
> > > > > > On Aug 6, 6:38 pm, BigKat <
aaronsah...@yahoo.com> wrote:
>
> > > > > > > In my web application, some of my ajax / javascript has undesired
> > > > > > > behavior whenfirebugis enabled. So I have javaScript that detects
> > > > > > >iffirebugis enabled.. Basically checking for window.__firebug__ to
> > > > > > > be present.
>
> > > > > > >Ifit is present I put up a warning message to the user. This works
> > > > > > > great for Firefox 2, but now that Firefox 3 is out the check I am
> > > > > > > using no longer is valid. Does anyone know of what I can be checking
> > > > > > > for in Firefox 3 to seeifFirebugis enabled?