11 ms·
A page with no code
- webscalist 4y agoswf is all you need
- IYasha 4y agobig hug
- pictur 4y agoI think it's time to write a blog article under the name you don't need the internet.
- jeffreygoesto 4y agoSigh. Wait until she learns about the static initialization order fiasco...
- jeffreygoesto 4y agoOh my. Should have gone here... https://news.ycombinator.com/item?id=34464993 https://news.ycombinator.com/item?id=34464993
- sshine 4y ago> It’ll probably only work if you’re using Firefox This sentence both made me think: "Seriously; a page that only works in one browser?" and "Finally something that only works in Firefox, that'll teach those Chromers!"
- chungy 4y agoDoes the page actually work for anyone? I'm on Firefox and as soon as I click the link from the blog, it's just forever loading.
- eterm 4y agoWorks for me (FF 109.0)
- encody 4y agoWorks for me on mobile Firefox 109.1.1
- fortran77 4y agoWorked for me on Windows 11 Firefox 109.0 64-bit
- IYasha 4y agoff 50, linux, works.
- avx56 4y agoFirefox 50 was released like a week after Trump was elected. They do have an LTS version if you just want stability: https://www.mozilla.org/en-US/firefox/enterprise/ https://www.mozilla.org/en-US/firefox/enterprise/ Or it was just a typo I don't know sorry
- IYasha 4y agoI just don't have the option to upgrade here. :-/
- defanor 4y agoNeat, but this part is a bit odd: > As a fan of CSS Naked Day and a firm believer in using JS only for progressive enhancement, I’m obviously in favour. ...And the page it is written on is slightly broken (images follow enlarged thumbnails of themselves) in FF with JS off.
- Dan-Q 4y agoThanks; I hadn't noticed that. It's a side-effect from some terrible CMS plugin I thought I'd disabled. Fixing it now. Edit: Fixed! Thanks again!
- pprotas 4y agoTechnically there is code on the back-end server, now make a webpage with no code at all
- dcminter 4y agoIs 'about:mozilla' close enough for you? (Firefox only obv.)
- oneeyedpigeon 4y agoAn empty file is technically a webpage, right?
- El_RIDO 4y agoWould a webserver configuration file count? The code on the webserver minifies the CSS file and embeds it into a Link header - you could configure a webserver to respond with a generated Link header and no content to a certain URL. Here is an example configuration file for nginx: https://snip.dssr.ch/?7a4e21dde5f7916b#2aPagYEg3kuWg3YN8Q5oz1DF8wFMth8GsFrFAqCyn5T4 https://snip.dssr.ch/?7a4e21dde5f7916b#2aPagYEg3kuWg3YN8Q5oz... Though I would argue that the header-embedded CSS is still code, regardless how it is delivered.
- quickthrower2 4y agobase64 encoded url thingy
- joshxyz 4y agoThinking of blob urls lol
- still_grokking 4y agoEasy. Just use the nocode language for that. https://github.com/kelseyhightower/nocode https://github.com/kelseyhightower/nocode
- Towaway69 4y agoI'm going wait until the Linux install script has been merged - https://github.com/kelseyhightower/nocode/pull/4967 https://github.com/kelseyhightower/nocode/pull/4967
- msla 4y agoThe only part I don't get isn't even about the page in question: > My first reaction was “why not just deliver something with Content-Type: text/plain; charset=utf-8 and dispense with the invalid code, but perhaps that’s just me overthinking the non-existent problem. Yes, it's about the HTML-less plain text page https://no-ht.ml https://no-ht.ml which is UTF-8 plain text which browsers should be able to render. Does anyone here have deep knowledge, quotes from grimoires, or relevant strange tales?
- edent 4y agoI wrote about it at https://shkspr.mobi/blog/2022/12/you-dont-need-html/ https://shkspr.mobi/blog/2022/12/you-dont-need-html/ I tested with a bunch of browsers on mobile and desktop - some browsers forced a download of plain text and / or wouldn't render the characters properly. Some browsers assume the server is lying and think they know best.
- conaclos 4y agoThanks for the post :) I am wondering: why do you use the obsolete <plaintext> instead of <pre>? Why do you use the `ml` extension? By the way, I noticed some issues in the page: - trailing whitespaces - mixed of spaces/tabs - some wide characters such as ▽ seems to create aligning issues
- edent 4y ago> why do you use the obsolete <plaintext> instead of <pre>? Because it is funny. > Why do you use the `ml` extension? Because it is funny. Also, it was free. > By the way, I noticed some issues in the page: The source is open. Feel free to correct those issues.
- mftb 4y agoWell, if it's not in the body of the response...
- d12bb 4y agoFinding the source in the header was obvious, but I can't figure how to decode that properly. I can see the rules for body{} and @keyframes{}, but no idea where all the text (the before/after rules) are hiding..
- ldjb 4y agoThe header " The Page With No Code " is in the html::before content property. The first paragraph "It all started when..." is in the body::before content. The second paragraph "This web page has..." is in the body::after content. And finally, the footnote "* Obviously there's some code somewhere..." is in the html::after content property. I ran the decoded base64 string through a CSS beautifier; this might help: https://gist.github.com/ldjb/8c6b6d83f2acd3cef01fcf56b36d65f3#file-no-code-webpage-beautify-css https://gist.github.com/ldjb/8c6b6d83f2acd3cef01fcf56b36d65f...
- d12bb 4y agoI found those in the inspector, sure. But I can't find them in the base64 encoded header. Edit: Nevermind. I tried like 10 different online base64 decoders before, till I found one wich didn't show just garbage (maybe they all hiccup on the emojis?), but even that one didn't decode properly as it seems. Either the eleventh one now told me the whole truth, or I should've used curl -i from the start instead of copy/pasting from Firefox's developer tools.
- AlexGuo1998 4y ago> ... instead of copy/pasting from Firefox's developer tools. You may toggle the "raw" switch in the upper-right corner, or Firefox will trim the header like "jh6…W5n".
- Symbiote 4y agocurl -SsI https://danq.me/wp-content/no-code-webpage/ | \ grep -i ^link: | \ cut -d, -f2 | cut -d\> -f1 | \ base64 -d The Base64 encoding is invalid, or at least not ideal, as the '==' padding has been removed [1]. Restoring it works: (curl -SsI https://danq.me/wp-content/no-code-webpage/ | \ grep -i ^link: | \ cut -d, -f2 | cut -d\> -f1; echo '==') | \ base64 -d [1] https://gist.github.com/Dan-Q/fc308a8a4aca2934312939f92eaa9d2e#file-_no_code_page_-php-L10 https://gist.github.com/Dan-Q/fc308a8a4aca2934312939f92eaa9d...
- andrewmackrodt 4y agoFor non firefox users wanting to manually render the page, grab the base64 output from the link response header, e.g. - open developer tools, navigate to network and refresh - or run from a terminal "curl -s --head 'https://danq.me/wp-content/no-code-webpage/ https://danq.me/wp-content/no-code-webpage/' | sed -nE 's/.*base64,([^>]+)>.*/\1/p'" - replace the base64 into the below code: document.head.innerHTML='<style>'+decodeURIComponent(atob('Ym9...9IA').split('').map(c => '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2)).join(''))+'</style>' - paste the above string into the developer tools console and press return
- dvdkon 4y agoGood job! That's so clever it crashed my Firefox.
- still_grokking 4y agoA plain text document caused as crash? That sounds really strange. It works fine for me on latest Linux Firefox.
- dvdkon 4y agoIt didn't like me clicking around in the dev tools trying to figure out how it works. I can't reproduce it now, so I suppose it was a freak bug.
- still_grokking 4y agoOh, the dev tools?! Yes, there's something not OK in FF in this regard. As I've clicked around in the inspector my fan went on and FF did hang for one or two seconds. My best guess would be that it doesn't like such a "long line" (as it shows all the chars without line breaks in the inspector). Also last year FF crashed once on my box while using the dev tools. I was shocked as usually nothing crashes on this box, ever. So they have likely some severe bugs left in the dev tools, I guess.
- lovasoa 4y agoRelated to https://no-ht.ml https://no-ht.ml : A few years ago, I wrote a small js library to convert HTML to unicode: https://www.npmjs.com/package/html2unicode https://www.npmjs.com/package/html2unicode
- lovasoa 4y agoTo see the magic: curl -I https://danq.me/wp-content/no-code-webpage/ | grep -oP 'base64,\K\w+' | base64 -d
- afandian 4y agoI'm not clear which bit doesn't work on other browsers. Is it the use of a Style Link in the headers rather than body? Or the use of an inline stylesheet as a data URI? Or the styling of a document with no content? Although the combination is unusual, none of those seems particularly exotic.
- wildrhythms 4y agoAgreed, also in the MDN compatibility table it says it's experimental, but that Chrome supports it, so maybe there's a difference in browser implementation handling it? https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Link#browser_compatibility https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Li...
- azeemba 4y agoLink header seemed very exotic to me. I was very surprised to hear that that exists
- javajosh 4y agoSame. And honestly its existence concerns me greatly, non-ironically.
- afandian 4y agoCurious, what’s concerning? Links à la IETF RFC 5988 are pretty vanilla web stuff.
- javajosh 4y agoThere is nothing worse than believing something that isn't true. Imagine trouble-shooting a front-end issue, and not knowing about this. You think you know where all the CSS is coming from, and that it couldn't possibly produce the effect you're seeing. But actually you do not know where all the CSS is coming from. Adding subresources via http header is pure evil.
- asim 4y agoCan I just say. I wish web pages were actually programmable. Every time I put together a website now I think damn, look at all this content stuck inside static html. I wish it was in a database and loaded from there, even if that database was a simple text file or whatever else. The web needs some evolution that isn't react and next.js. Going back to pure text is killer.
- est 4y agoXSLT?
- still_grokking 4y agoFrankly HTML5 isn't XML any more. Very bad move…
- andai 4y agoDoes anyone know why XHTML failed? I remember deriving some satisfaction from making my website XHTML compliant back in the day. Wouldn't it make it much easier to parse? Or does the motivation to "make stuff still try to work even when it's clearly broken" override that? (The same motivation gave us everything that's wrong with JavaScript, so I'm not sure I agree with it...)
- chc 4y agoXHTML was not backwards compatible and was harder to write for essentially no benefit to most people. "It's XML" was basically the entire list of selling points, and that was just not a compelling enough proposition — in fact, for many people, that was negative value.
- still_grokking 4y ago> XHTML was not backwards compatible Sure? I think it was HTML4 that was not forwards compatible. XML is a subset of SGML, and HTML4 was SGML. XHTML was / is XML. So HTML4 parsers (as being SGML parsers) shouldn't have issues with XHTML. It's the other way around: XML parsers don't like HTML. So the attempt failed to change the default parsers to XML; as old webpages had than issues, and the web crowd didn't like to fix that. People wanted to continue to use the horrible SGML mess—only because nobody wanted to touch their HTML4. So Google created their own web "standards council" and ignored the W3C henceforth. The rest is history.
- skeyo 4y agoRIP screen readers
- rav 4y agoDoes it also work if the response code is changed to HTTP 204 No Content?
- jwilk 4y agoIt does.
- osrec 4y agoPeople can choose to avoid JS if they want, but a lot of users get a HUGE amount of value from JS. The web is an app delivery platform now, not just an information delivery platform. Plus, we have a lot of processing power on the client side, which should be utilised. JS, when used well is not a bad thing. If a site uses it badly, just don't go to that site.
- AviationAtom 4y agoI think PWAs are the future. The industry is just slow at getting to it.
- robgibbons 4y agoIt's not that the industry is slow. It's just hard to push PWAs forward when Apple is actively hostile toward web apps.
- catiopatio 4y agoThe only people who truly want PWAs are web developers and product managers that do not prioritize their users. Why learn anything new or spend anything extra when you can just ship substandard web crapware to users who have no choice (looking at you, Slack).
- smhg 4y agoIsn't that like saying only big companies with specialized roles are allowed to provide app-like functionality? Among others, smaller shops and single-person companies surely benefit from one delivery platform if you ask me. Even if it's not perfect.
- cheeaun 4y agohttps://css-tricks.com/using-css-without-html/ https://css-tricks.com/using-css-without-html/ (2010)
- IYasha 4y agoJS is SO overused and abused right now! It so happens that two months ago my cell ISP revamped their user page in such way that it no longer displays ANYTHING. No accounting, no payments, no traffic, not a single letter. On all of my browsers. Just because it (possibly) looks cool? Or money must be spent. Or whatever. And you can't file a complain - all you get is an AI chat bot. Of course it doesn't help bringing the site back of getting HTTP API. But it excels at annoying customers. Anyway, customer support was almost always useless: "Update you browser, buy a new device" is all they have to say.
- Sephr 4y agoI made some similar concepts using generated content via Link header stylesheets over a decade ago at https://code.eligrey.com/css/link-header https://code.eligrey.com/css/link-header For example, this CSS[1] resulted in a professional-looking 'blog post' layout complete with a header, subtitle, metadata, and footer when paired with a plaintext file. I've also used this functionality to directly add titles to non-HTML content such as images[2]. Unfortunately no extant browser engines support this anymore. 1. https://code.eligrey.com/css/link-header/lorem-ipsum-2.css https://code.eligrey.com/css/link-header/lorem-ipsum-2.css 2. https://eligrey.com/blog/title-image-files-in-opera/ https://eligrey.com/blog/title-image-files-in-opera/ (contains dead link to demo)
- fijiaarone 4y agoContent-type: image/gif
- joshmarinacci 4y agoYou can do a whole lot with just 20 lines of modern JS.
- Dan-Q 4y agoNo JS on that page either!
- cableshaft 4y agoNothing loaded for me in Chrome. Just a blank page and the following warning in the console: "DevTools failed to load source map: Could not load content for chrome-extension://[removed]/sourceMap/chrome/scripts/iframe_form_check.map: System error: net::ERR_BLOCKED_BY_CLIENT" Which might not be related, not sure, and not awake enough to dig into it further. Did it not load properly for anyone else?
- jeroenhd 4y agoThat error indicates something weird going on with one of your extensions. The guid tells you what extension is generating the error so you can disable it. I don't know why your browser is blocking a request to open the source code for one of your extensions. Maybe an extension trying to hide its own code? To find out what's causing this, disable all extensions and enabled them one by one until the problem occurs, I suppose. It'll be harder to find if your problem is caused by two different extensions, in which case you're going to need to test pairs...
- dang 4y agoRelated: You Don't Need HTML - https://news.ycombinator.com/item?id=33645398 https://news.ycombinator.com/item?id=33645398 - Nov 2022 (32 comments) HTML is all you need to make a website - https://news.ycombinator.com/item?id=33642490 https://news.ycombinator.com/item?id=33642490 - Nov 2022 (153 comments)