Why isn't it being assembled as HTML that can be viewed in document inspector or via viewing source? Ht HTML that extensions inspect shows up. If it is assembled to be rendered, why isn't it available anywhere else in the browser to view?
It's using CSS, specifically the `content` property. You can use developer tools in Firefox to inspect it.
Contentlesshtml – An HTML page served entire in HTTP headers
11–20 of 20 posts
Re: Contentlesshtml – An HTML page served entire in HTTP headers
#12How much can one pack into the header? Is there a limit?
Re: Contentlesshtml – An HTML page served entire in HTTP headers
#13How much can one pack into the header? Is there a limit?
What’s the point besides a curious hack?
Re: Contentlesshtml – An HTML page served entire in HTTP headers
#14Re: Contentlesshtml – An HTML page served entire in HTTP headers
#15 link ; rel="stylesheet"
which is, when base64-decoded: * {
background-color: cyan;
}
body::after {
content: "Hi! This is served entirely in the HTTP headers! Pretty cool, huh?";
font-size: 24px;
font-family: cursive;
text-shadow: 2px 2px 2px pink;
}
[1] https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Li...Re: Contentlesshtml – An HTML page served entire in HTTP headers
#16Why isn't it being assembled as HTML that can be viewed in document inspector or via viewing source? Ht HTML that extensions inspect shows up. If it is assembled to be rendered, why isn't it available anywhere else in the browser to view?
It's using CSS, specifically the `content` property. You can use developer tools in Firefox to inspect it.
- Stylesheet encoded as base64 in the Link header;
- Browsers always implicitly have at least the html and body tags;
- CSS cannot create new elements, but it does get 2 free pseudo-elements per actual element, ::before and ::after;
- CSS can set textual content for pseudo-elements;
So, it sets content to a pseudo element of an implicitly created tag, that's why the page is so minimal.
(Well, it could be up to 4 times as complicated I think, by using the other 3 pseudo-elements. Or cheat by using a big SVG as a background-image with more complex contents, but then you start running into header size limits and whatnot)
Re: Contentlesshtml – An HTML page served entire in HTTP headers
#17Re: Contentlesshtml – An HTML page served entire in HTTP headers
#18How much can one pack into the header? Is there a limit?
What’s the point besides a curious hack?