In the Webkit Inspector, I can go to the elements panel and unfold the DOM elements so I can see what I'm interested in.
So far, when I find what I'm looking for, change code, and reload the page, the DOM tree in the Elements panel is folded back up.
Is there any way to either, A) Get the Inspector to remember where I was and try to open the DOM tree to where I was, or B) Keep the DOM tree unfolded by default?
If you hold ctrl + alt for windows (just opt on a mac) while clicking on the arrow of the element you want to expand, it will expand and all of its children will expand. So, if you ctrl + alt click on the <html> tag, that should expand the entire page.
Press Control + F or Command + F (Mac). The Search bar opens at the bottom of the DOM Tree.
To get all DOM elements by an attribute, use the querySelectorAll method, e.g. document. querySelectorAll('[class="box"]') . The querySelectorAll method returns a NodeList containing the elements that match the specified selector.
I had this same question. I'm using Chrome on Win XP so I can only tell you the solution I found for Chrome, but I imagine the process is very similar for other Webkit browsers.
I navigated to the Chrome Application Data folder: C:\Documents and Settings\[USERNAME]\Local Settings\Application Data\Google\Chrome\Application[NEWEST VERSION]\Resources\Inspector
Obviously fill in [USERNAME] and [NEWEST VERSION] with the folders YOU have on your computer.
Closed the browser.
I opened DevTools.js in Notepad++ and started hunting. It turns out that the webkit inspector adds a css property of "expanded" on tags when you click on the little arrow.
On line 1484 There is a boolean for the default value. I simply changed this.expanded=false to this.expanded=true
Fired up Chrome and badda-bing, all the elements in the inspector are expanded by default.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With