BrowserLink changes document structure unexpectedly
SteveSandersonMS opened this issue · comments
The default ASP.NET Core MVC site template, when viewed in the Chrome "Elements" inspector, looks like this:
However, if BrowserLink is enabled, it looks like this:
Obviously, the addition of the <!-- Visual Studio Browser Link -->
block is correct, but the other changes are unexpected:
- Why has everything from
<head>
been moved into<body>
? - Why is
<body>
prefixed with the nonbreaking whitespace char (
)?
Adding @jodavis
The answer to "Why has everything from <head>
been moved into <body>
?" is probably that the Chrome "Elements" inspector is showing a representation of the DOM, rather than the raw HTML that was rendered by the server. When there's text content before the <head>
or <html>
tags, browsers typically treat that as the beginning of the body, regardless of where the <body>
tag is.
So the real question is, where did that extra nonbreaking whitespace come from? That I don't know. It sounds like I should be able to reproduce this easily, so I will debug into it.
@SteveSandersonMS Do you have any Browser Link extensions installed (e.g. Web Essentials)?
@SteveSandersonMS I'm not able to reproduce this. What version of Web Tools and ASP.NET Core are you using? Did you make any other changes to the project?