Object printing in console

8 views
Skip to first unread message

Tomasz Wegrzanowski

unread,
Apr 18, 2010, 8:26:24 PM4/18/10
to Firebug
One thing that has bothered me about Firebug is how it prints small
objects.

Let's say I do this in firebug console:
>>> document.getElementsByTagName("div")[0].getBoundingClientRect()

What I get is fairly useless:
ClientRect { constructor=ClientRect, more...}

on which I need to click to get to the DOM tab and see the values. If
I'm trying to see such objects for a few elements, this constant
switching between console tab and dom tab gets really annoying.

Is there any reason why firebug couldn't just display all fields of an
object if they're simple and not too numerous?

(this issue isn't unique to ClientRect, such small objects are fairly
widespread in many javascript contexts; there's no need to pursue the
most general possible solution which might be difficult, just to make
simple cases work)

--
You received this message because you are subscribed to the Google Groups "Firebug" group.
To post to this group, send email to fir...@googlegroups.com.
To unsubscribe from this group, send email to firebug+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/firebug?hl=en.

John J Barton

unread,
Apr 19, 2010, 12:08:55 AM4/19/10
to Firebug


On Apr 18, 5:26 pm, Tomasz Wegrzanowski
<tomasz.wegrzanow...@gmail.com> wrote:
> One thing that has bothered me about Firebug is how it prints small
> objects.
>
> Let's say I do this in firebug console:
>
> >>> document.getElementsByTagName("div")[0].getBoundingClientRect()
>
> What I get is fairly useless:
> ClientRect { constructor=ClientRect,  more...}
>
> on which I need to click to get to the DOM tab and see the values. If
> I'm trying to see such objects for a few elements, this constant
> switching between console tab and dom tab gets really annoying.
>
> Is there any reason why firebug couldn't just display all fields of an
> object if they're simple and not too numerous?
>
> (this issue isn't unique to ClientRect, such small objects are fairly
> widespread in many javascript contexts; there's no need to pursue the
> most general possible solution which might be difficult, just to make
> simple cases work)

This display seems to be controlled by shortPropIterator:
http://code.google.com/p/fbug/source/browse/branches/firebug1.6/content/firebug/reps.js#356
Currently it only prints one property. I'll investigate setting to a
larger value.

jjb

woomla

unread,
Apr 19, 2010, 4:04:52 AM4/19/10
to Firebug
Awesome, you can easily make it larger to see more properties! Really
beautifull.

I would like to vote for this to be adjustable.


On Apr 19, 6:08 am, John J Barton <johnjbar...@johnjbarton.com> wrote:
> On Apr 18, 5:26 pm, Tomasz Wegrzanowski
>
>
>
> <tomasz.wegrzanow...@gmail.com> wrote:
> > One thing that has bothered me about Firebug is how it prints small
> > objects.
>
> > Let's say I do this in firebug console:
>
> > >>> document.getElementsByTagName("div")[0].getBoundingClientRect()
>
> > What I get is fairly useless:
> > ClientRect { constructor=ClientRect,  more...}
>
> > on which I need to click to get to the DOM tab and see the values. If
> > I'm trying to see such objects for a few elements, this constant
> > switching between console tab and dom tab gets really annoying.
>
> > Is there any reason why firebug couldn't just display all fields of an
> > object if they're simple and not too numerous?
>
> > (this issue isn't unique to ClientRect, such small objects are fairly
> > widespread in many javascript contexts; there's no need to pursue the
> > most general possible solution which might be difficult, just to make
> > simple cases work)
>
> This display seems to be controlled by shortPropIterator:http://code.google.com/p/fbug/source/browse/branches/firebug1.6/conte...

John J Barton

unread,
Apr 19, 2010, 8:53:56 PM4/19/10
to Firebug


On Apr 19, 1:04 am, woomla <woo...@gmail.com> wrote:
> Awesome, you can easily make it larger to see more properties! Really
> beautifull.
>
> I would like to vote for this to be adjustable.

extensions.firebug.ObjectShortIteratorMax defaults to 3, only way to
change it is via about:config and restarting. R6588.

jjb

woomla

unread,
Apr 20, 2010, 4:04:15 AM4/20/10
to Firebug
Excellent, thanks

Tomasz Wegrzanowski

unread,
Apr 20, 2010, 7:06:17 PM4/20/10
to Firebug
This is amazing, thanks a lot.
> > > > You received this message because you are subscribed to the Google Groups "Firebug" group.> > > To post to this group, send email tofi...@googlegroups.com.> > > To unsubscribe from this group, send email tofirebug+...@googlegroups.com.
> > > > For more options, visit this group athttp://groups.google.com/group/firebug?hl=en.
>
> > > --
> > > You received this message because you are subscribed to the Google Groups "Firebug" group.> > To post to this group, send email tofi...@googlegroups.com.> > To unsubscribe from this group, send email tofirebug+...@googlegroups.com.
> > > For more options, visit this group athttp://groups.google.com/group/firebug?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups "Firebug" group.> To post to this group, send email tofi...@googlegroups.com.> To unsubscribe from this group, send email tofirebug+...@googlegroups.com.
> > For more options, visit this group athttp://groups.google.com/group/firebug?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups "Firebug" group.To post to this group, send email tofi...@googlegroups.com.To unsubscribe from this group, send email tofirebug+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages