Mozilla VPN is currently experiencing an outage. Our team is actively working to resolve the issue. Please check the status page for real-time updates. Thank you for your patience.

為了改善您的使用體驗,本網站正在進行維護,部分功能暫時無法使用。若本站的文件無法解決您的問題,想要向社群發問的話,請到 Twitter 上的 @FirefoxSupport 或 Reddit 上的 /r/firefox 發問,我們的社群成員將很快會回覆您的疑問。

搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

了解更多

How to view HTML DOM property when selecting elements in Inspector?

  • 6 回覆
  • 1 有這個問題
  • 1 次檢視
  • 最近回覆由 jhnlmn

more options

Hi When I open Inspector from Firefox Developer Tools and select an HTML node, inspector shows numerous CSS related items for that node (like Rules, Layout, Computed, etc), but it does not show basic HTML DOM properties. In particular, I need to see innerText property for the currently selected node (and then walk through HTML tree watching innerText for every node). I found that I can do Right Click, Show DOM properties and than it prints all properties to the Web Console window, but this is not convenient: I have to repeat this Right Click thing for every element and search for innerText every time. This will take forever. So, question: is it possible to somehow show innerText for the current node automatically (like those CSS items are shown)? Thank you

Hi When I open Inspector from Firefox Developer Tools and select an HTML node, inspector shows numerous CSS related items for that node (like Rules, Layout, Computed, etc), but it does not show basic HTML DOM properties. In particular, I need to see innerText property for the currently selected node (and then walk through HTML tree watching innerText for every node). I found that I can do Right Click, Show DOM properties and than it prints all properties to the Web Console window, but this is not convenient: I have to repeat this Right Click thing for every element and search for innerText every time. This will take forever. So, question: is it possible to somehow show innerText for the current node automatically (like those CSS items are shown)? Thank you

被選擇的解決方法

I gave up on the approach of giving dev tools an object and threw the DOM property values into an HTML page. Currently, it doesn't have any conveniences related to collapsing, but hopefully the full content is there. New download:

https://www.jeffersonscher.com/temp/devtools-text_v0.2.zip

從原來的回覆中察看解決方案 👍 1

所有回覆 (6)

more options

Hi jhnlmn, glad to see you in Mozilla Support Forum.

You can try this:-

Enabling the DOM Property Viewer

The DOM Property Viewer is not enabled by default. To enable it, open the developer tool settings and check the "DOM" box under "Default Firefox Developer Tools".

Opening the DOM Property Viewer

Once enabled, you can open the DOM Property Viewer by selecting "DOM" from the Web Developer submenu in the Firefox Menu Panel (or Tools menu if you display the menu bar or are on macOS), or by pressing its Ctrl + Shift + W keyboard shortcut.

The Toolbox will appear at the bottom of the browser window, with the DOM Property Viewer activated. It's just called "DOM" in the Toolbox.

Reference:- Article

If it doesn't solved your problem, feel free to ask in Reply Section. Thanks for raising your question in Mozilla Support Forum.

more options

Thank you for your reply. I already had DOM Property Viewer enabled, but I cannot figure out what it is good for. DOM Property Viewer displays properties of the window object, but I need to display properties of the object, which is selected in Inspector and I need these properties to be updated as I walk through the inspector tree, just like CSS properties are updated in Rules/Layout/Computed windows. Is it possible? (I know that I can walk through the window/document/children tree in DOM window, but is it not as easy as walking through the inspector tree). Thank you

more options

Hmm, I tried to create an add-on for this, but I get something that looks like JSON.stringify() output, so it's not attractive for multi-line text nodes (and pink text is a bit hard on the eyes). You could try it out using the about:debugging page to load the extension temporarily and see what you think:

Not sure of the best way to proceed because most things I've tried to work around that simply fail or make it worse.

more options

Thank you, almost there.

There is one limitation of your method: if text is too large, then it is shortened and "..." is displayed at the end. When I use 'Right Click, Show DOM properties' it prints the same pink text with the same formatting as your code and it is also shortened with "...", but it has a small triangle that allows me to expand the text and see the whole text, but this trick does not work with your pane. I wonder whether it is possible to do similar thing - print text to Web Console. I tried to use console.log, but nothing comes out. Do you know how 'Right Click, Show DOM properties' works?

Thank you

more options

選擇的解決方法

I gave up on the approach of giving dev tools an object and threw the DOM property values into an HTML page. Currently, it doesn't have any conveniences related to collapsing, but hopefully the full content is there. New download:

https://www.jeffersonscher.com/temp/devtools-text_v0.2.zip

more options

Perfect Thank you very much