16

I am working in Chrome developer tools and looking for a way to show HTML entities by default.

The view I see is this:

enter image description here

Whereas, the view I need is this:

enter image description here

Does anybody know how I can enable the view I need?

I know there is a theme engine for Chrome but is there an existing feature that fits my needs?

Thanks guys ;)

user1063287
  • 10,265
  • 25
  • 122
  • 218
Sebastian Haas
  • 261
  • 2
  • 3
  • Did you ever figure out how to display the true source code? – dustinmoris Jul 12 '17 at 15:30
  • 1
    Nope. :( However, there is Burpsuite... I just use this. But I'm still interested in a solution to this issue :) – Sebastian Haas Jul 12 '17 at 18:55
  • In your source code you have written `&` or `&`? – Justinas Aug 07 '19 at 10:58
  • 1
    I don't know how to make developer tools show the unencoded version in the inspect window, but I do notice that if I right click an element and copy it, then when I paste it into another application it pastes the original (encoded) text, not the decoded version that Chrome was showing me. – user756366 Dec 04 '19 at 19:55

3 Answers3

1

I had this same question and discovered that with chrome, right-click > View Source code, shows the pure un-decoded(un-evaluated) html entities while the right-click > inspect option seems to evaluate them... may help someone:)

  • 1
    This does not always work because View Source reloads the document, even sometimes [sending the wrong UA on mobile development](https://bugs.chromium.org/p/chromium/issues/detail?id=1257521#c3). – dotancohen Oct 11 '21 at 10:30
1

In Google Chrome the correct way to see the actual source of the document that is currently loaded is to click the Sources tab and choose the file from the tree on the left. If you have a unique string on the line that you're searching for, you can press Ctrl-Shift-F to search all files for that string.

  • RightClick -> View Source is incorrect because it reloads the document, which may cause unexpected behaviour.
  • Inspect Element is incorrect because it displays the current DOM, not the HTML source.
dotancohen
  • 30,064
  • 36
  • 138
  • 197
0

You can't: The DOM Inspector shows a view of the DOM, not the source code.

The HTML has already been parsed and the entities converted to characters in text nodes.

The Inspector shows an HTML-like view because it is easy to understand. It doesn't reflect the original source code.

Browsers have an explicit "View Source" feature if you want to see the source code.

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335