本文介绍了如何保持“元素” (DOM)树在Webkit检查器中打开?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Webkit检查器中,我可以去元素面板并展开DOM元素,以便我可以看到我感兴趣的内容。

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.

到目前为止,我找到我正在寻找的内容,更改代码并重新加载页面,元素面板中的DOM树被折回。

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.

有没有办法A)让检查员记住我在哪里,并尝试打开DOM树到我所在的地方,或者B)保持DOM树默认展开?

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?

推荐答案

我有同样的问题。我在Win XP上使用Chrome,所以我只能告诉你我为Chrome找到的解决方案,但我想像这个过程与其他Webkit浏览器非常相似。

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.

我导航到Chrome应用程序数据文件夹:
C:\Documents and Settings\ [USERNAME] \Local Settings\Application Data\Google\Chrome\Application [NEWEST VERSION] \Resources\检查员

I navigated to the Chrome Application Data folder:C:\Documents and Settings\[USERNAME]\Local Settings\Application Data\Google\Chrome\Application[NEWEST VERSION]\Resources\Inspector

显然,用你电脑上的文件夹填写[USERNAME]和[NEWEST VERSION]。

Obviously fill in [USERNAME] and [NEWEST VERSION] with the folders YOU have on your computer.

关闭浏览器。

我在Notepad ++中打开了DevTools.js,并开始狩猎。事实证明,当您点击小箭头时,webkit检查器会在标签上添加一个扩展属性。

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.

在线1484默认情况下有一个布尔值值。我简单地将
this.expanded = false更改为this.expanded = true

On line 1484 There is a boolean for the default value. I simply changedthis.expanded=false to this.expanded=true

在Chrome和badda-bing中,检查器中的所有元素都被扩展默认。

Fired up Chrome and badda-bing, all the elements in the inspector are expanded by default.

这篇关于如何保持“元素” (DOM)树在Webkit检查器中打开?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-30 12:15