Bug 32082 - Show DOM information as firebug console does
Summary: Show DOM information as firebug console does
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL: http://cliffordmeece.com
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-02 12:15 PST by Cliff
Modified: 2014-12-12 14:08 PST (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Cliff 2009-12-02 12:15:21 PST
In the firebug console, the DOM tab has several options that can be enabled.  One of them is 'Show user-defined properties'.  This is incredibly useful, because you can tell at a glance what javascript objects and properties are available for you to use, which is a common task in today's world of mashups and integrations.

Is this info available somewhere in Web Inspector?  I don't really care if it looks like firebug or not, I would just like a convenient place to get the information.  As an example, go to http://drupal.org in firefox and open firebug.  Click on the DOM label, and if you have 'Show user-defined properties' set, you will see a top-level 'Drupal' object defined.  Browsing through it you can see all the properties and objects that are available that you may need to use when integrating a third-party javascript on a drupal site.  It would be great if that same functionality were somewhere in Web Inspector.


thanks,
Cliff
Comment 1 Timothy Hatcher 2009-12-04 09:30:17 PST
We show you DOM properties for the selected DOM element. But we don't have access to the Window or Document object. We need to fix that.
Comment 2 Timothy Hatcher 2009-12-04 09:33:44 PST
One idea Sam had a while back was to show Window and Document in the element tree, at the root level with a divider then the DOM elements. This would avoid nesting the whole DOM tree and give these objects a special status.

We would do this for iframes too, have the Window and Document inside the iframe element decorated in some way to disinguish them and have the regualr dom elements.
Comment 3 Cliff 2009-12-04 09:45:10 PST
That sounds like it might be ok.  Having them nested in the element tree would be a nightmare though.  I'm kinda a newbie to DOM in general though so I get confused about distinctions between DOM elements, Window, Document, etc.

(In reply to comment #2)
> One idea Sam had a while back was to show Window and Document in the element
> tree, at the root level with a divider then the DOM elements. This would avoid
> nesting the whole DOM tree and give these objects a special status.
> 
> We would do this for iframes too, have the Window and Document inside the
> iframe element decorated in some way to disinguish them and have the regualr
> dom elements.
Comment 4 Timothy Hatcher 2009-12-04 10:56:51 PST
The Window and Document would not be nested. They would be seperate with some decoration distinguishing them.
Comment 5 Pavel Feldman 2009-12-04 12:38:37 PST
Why loading UI with those, is dumping 'window' or 'document' in console and learning 'Drupal's properties not enough?
Comment 6 Timothy Hatcher 2009-12-04 12:44:59 PST
Pavel, it would be useful to see the event listeners, and the prototype segregated properties.
Comment 7 Cliff 2009-12-04 12:54:19 PST
It's not merely an issue of reading Drupal docs to understand their properties.  It's a top level object that many contributed modules use to store config information, and since Drupal is built around many modules, you ould potentially have 40 different modules, all with varying levels of documentation about what javascript variables they are setting, that it would help to just have a handy browser.  Firebug does this extremely well and it doesn't pollute or clutter the ui as far as i can tell.  They separate it from the elements browser as a separate tab.

Beside the Drupal object, there may be other libraries added, all of which have a hierarchy of objects, properties, and functions.

Just browsing my homepage, which is a typical drupal install, I see (with firebug)  objects defined for Drupal, lightbox, jquery, addthis, tinymce, etc, etc.

But I am interested in your suggestion of 'dumping window in console'.  Can you tell me how to do that?
Comment 8 Timothy Hatcher 2009-12-04 13:00:00 PST
Just type "window" with no quotes in the Console and hit return. Then expand the object to browse the properties.
Comment 9 Cliff 2009-12-04 13:06:29 PST
Awesome! thanks.  I still think it would be nice to have it as a selectable ui element somewhere (unobtrusive of course).  But as I said in the original bug report "I don't really care if it
looks like firebug or not, I would just like a convenient place to get the
information". Dumping the variable is an acceptable work around.

If you decide to move forward with implementing it as a UI element, that would be great, but I'm happy for you close the bug otherwise since I now know where to get the info.


(In reply to comment #8)
> Just type "window" with no quotes in the Console and hit return. Then expand
> the object to browse the properties.
Comment 10 Brian Burg 2014-12-12 14:08:11 PST
Closing as invalid, as this bug pertains to the old inspector UI and/or its tests.
Please file a new bug (https://www.webkit.org/new-inspector-bug) if the bug/feature/issue is still relevant to WebKit trunk.