增加 Firebug 中 HTML 元素嵌套的限制?
我有一个页面,其中包含从框架生成的深度嵌套的 HTML 元素。我想用 Firebug 来检查它。 在一定深度处,Firebug 不再显示元素内容。
重现该问题的最简单方法是使用此 Perl 代码片段。它将创建 100 个嵌套 div,每 10 个文本。
foreach $i (1 .. 100) {
print "<div id=\"$i\">\n";
print $i if (0 == ($i % 10));
}
print "</div>\n" x 100;
使用 Firebug 检查文本“100”,在 div 96 而不是只有
<div id="96">
... contents ...
是否
<div ="">
可以增加 Firebug 可以处理的深度?
版本为 Windows Firefox 7.0.1 和 Firebug 1.8.3
Chrome 中的“检查元素”在此示例中运行良好,Internet Explorer 8 中的 F12 检查也是如此。
I have a page with deeply-nested HTML elements generated from a framework. I would like to inspect it with Firebug.
At a certain depth Firebug no longer displays the element contents.
The simplest way to reproduce the issue is with this perl snippet. It will create 100 nested divs, with text every 10.
foreach $i (1 .. 100) {
print "<div id=\"$i\">\n";
print $i if (0 == ($i % 10));
}
print "</div>\n" x 100;
Using Firebug to inspect the text "100", at div 96 instead of
<div id="96">
... contents ...
there is only
<div ="">
Is it possible to increase the depth that Firebug can cope with?
Versions are Windows Firefox 7.0.1 with Firebug 1.8.3
The "inspect element" in Chrome works fine with this example, as does F12 inspection in Internet Explorer 8.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
首先,正如一些评论中已经提到的:什么框架可以产生这种深度? :) 最好尝试解决这个问题。
回到你的问题,我推测你的问题的答案是深度是由 Firefox 而不是 Firebug 决定的,因此无法更改。
FB 插件是开源的。我以前从未看过它,但浏览了一下 这个源文件似乎是使用
aria-expanded
属性来创建树的。推测更多,基于 这个 aria 属性 我猜想Firefox 将最大值设置为 100 左右。顺便说一句,有趣的是,如果我在 Firebug 中继续使用“右”箭头键展开,它似乎会一直展开到第 100 个 div:可以在 html 上方的栏中(以及 {Console, Html, ...} 栏下方)看到这一点。这只是折叠/展开可视化在某个最大深度处停止。
First things first, as mentioned in some comments already: what framework generates that kind of depth? :) Best try to solve that.
Back to your question, I would speculate the answer to your question is that the depth is determined by Firefox, not Firebug, and thus cannot be changed.
The FB addon is open source. I had never looked at it before, but glancing over this source file it seems the
aria-expanded
attribute is used to create trees. Speculating even more, based on this aria attribute I would guess that Firefox has that value-max set somewhere around 100.Funny thing to note by the way, if I keep expanding in Firebug with the 'right' arrow key it does seem to expand all the way down to the 100th div: you can see this in the bar just above the html (and just below the {Console, Html, ...} bar). It's just the collapse/expand visualization that stops at some max depth.
就像之前的评论一样,我建议尝试不使用该框架,或对其进行修改。
Like the previous comment, I would suggest trying not to use that framework, or amending it.