A page with no code
danq.me
danq.me
- open developer tools, navigate to network and refresh
- or run from a terminal "curl -s --head '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
A few years ago, I wrote a small js library to convert HTML to unicode: https://www.npmjs.com/package/html2unicode
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
2. https://eligrey.com/blog/title-image-files-in-opera/ (contains dead link to demo)
> 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.
Edit: Fixed! Thanks again!
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.
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Li...
This feature needs to die.
It may not be normal in your day-to-day work, but it's definitely an important point of extensibility. Extensibility is indeed opposed to management (see _The Principle of Least Power_ for more on that front) but that is a trade off that worked really well for the web for decades. I for one would be really sad to see this further limited and would love for browser support for `Link` header behavior to increase rather than decrease.
It's almost as if software engineers are doomed to this pendulum of constraining and then under constraining. It happened with SQL and noSQL and it seems to be happening now with HTTP. Constraints are for your own benefit but maybe it takes time to really grok that.
As svieira says above, Link is a standard thing. It’s widely used. CSS is even based on it. Another example is ‘canonical’.
https://http.dev/link#canonical
You may not have encountered it personally, but I don’t think it’s wise to extrapolate from that.
curl -I https://danq.me/wp-content/no-code-webpage/ | grep -oP 'base64,\K\w+' | base64 -dWouldn'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...)
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.
But HTML can be also written in some absolute quirky way that isn't even SGML. Just a horrible mess!
As much as I wanted it to work out (and tried making a personal website using it for a little while), I would never go back to it today.
It might be not as interactive as mostly of websites, but it allows you to get data through API or develop own client.
You can open up the DevTools and start poking around - including running your own JS against the page DOM using the console.
You can write bookmarklets, or user scripts, or even fill browser extensions that run your own custom scripts.
You can even run a headless browser to automate this stuff further - a trick I use a bunch with my shot-scraper CLI tool, see https://simonwillison.net/2022/Mar/14/scraping-web-pages-sho... and https://til.simonwillison.net/shot-scraper/scraping-flourish
We could have tested those idea in a similar fashion as React and next.js in Javascript, and incorporate what works as native HTML. Before sort of refactoring HTML into something else.
But Google doesn't want that. Google wants everything on the web to be Javascript. So yes. Blame Google.
> 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 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?
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.
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
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.
It works fine for me on latest Linux Firefox.
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.
Here is an example configuration file for nginx: https://snip.dssr.ch/?7a4e21dde5f7916b#2aPagYEg3kuWg3YN8Q5oz...
Though I would argue that the header-embedded CSS is still code, regardless how it is delivered.
I ran the decoded base64 string through a CSS beautifier; this might help: https://gist.github.com/ldjb/8c6b6d83f2acd3cef01fcf56b36d65f...
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.
You may toggle the "raw" switch in the upper-right corner, or Firefox will trim the header like "jh6…W5n".
curl -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/fc308a8a4aca2934312939f92eaa9d...btoa() should be base64 to ascii
atob() should be ascii to base64
Edit: it’s other way around, lolwut. https://developer.mozilla.org/en-US/docs/Web/API/atob
> The btoa() method creates a Base64-encoded ASCII string from a binary string (i.e., a string in which each character in the string is treated as a byte of binary data).
https://developer.mozilla.org/en-US/docs/Web/API/btoa
So the naming makes sense after all.
btoa() is binary to (base64 encoded) ascii.
But I’m still not gonna remember this either :^)
You Don't Need HTML - 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 - Nov 2022 (153 comments)
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.
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).
Among others, smaller shops and single-person companies surely benefit from one delivery platform if you ask me. Even if it's not perfect.
No arguments there.
> Plus, we have a lot of processing power on the client side, which should be utilised.
I don't agree with the "should" here at all. Lots of the stuff is done on the client these days which could be done cheaper on the server. If I'm visiting a site that's developed as an application then I fully expect to running a bunch of JS, no qualms there. But there is no reason my phone should be forced to build a bunch of HTML just so I can read an article, and that's the problem: people are developing information sites as "apps". This is a large factor of why my phone can't hold a charge for a full day.
This statement nails the problem that all of us suffer from. It’s like people have to add “feature” to make their site compelling because the information on it is not good enough.
Unfortunately, I don't think there'd be enough takers to make it a viable product.
Information for free, without ads, is tough to do.
But the goal usually isn’t to let you read an article.
Often the goal is to get you to read another article, click an ad, sign up for a newsletter, or buy a subscription. Apps can be good for all that.
You are correct here: the goal is to get you to read another article, click an ad, sign up for a newsletter, or buy a subscription
But I think that contradicts the idea users get a lot of value from JS.
You are correct, and
But because we're not neanderthals, you can also whitelist the sites/apps you like to run JS (in Chrome) and/or use another browser for your JS-powered sites/apps.
That said the modern web is generally very broken with js off, but it does get rid of most cookie banners, modal email sign ups prompts and generally lets your read article number 6 of the 5 free ones.
That does not mean it should be utilised by you. Have some humility as a developer.
It would be one thing if this was a matter of consent. It isn't. It uses your resources without your permission. Leaving JS on is not permission to consume as much CPU as you want (otherwise, every website would also run a crypto miner).
> If a site uses it badly, just don't go to that site.
This sort of blitheness is very surprising to me. What if we're talking about a passport site, or an unemployment benefits site, and so on? Why is the onus on the user and not the developer?
If the user is forced to use a terrible government website (as we all are from time to time), removing JS will fix absolutely nothing there. If anything, it might make things worse, as there will be a bunch of things you simply cannot do without JS (e.g cropping a photo to upload to a passport site - how would you even draw out the crop region without JS?!)
JS is not the problem. Crappy developers and corrupt officials who award key contracts to crappy developers are the problem.
Ads are are a nuisance race to the bottom.
I think a lot of these "you don't need JS" things you see out there are either (a) a sensible reminder that your JS-filled app doesn't have to do EVERYTHING with JavaScript (looking at you, JSS), (b) a contrarian "JS sucks" take, (c) an appeal to use outdated tech like PHP instead, or (d) just a clever way of getting attention on sites like hackernews.
It's this JavaScript that is loaded at the bottom of every page:
https://news.ycombinator.com/hn.js
There is a no-JS fallback. If you disable JS with uBlock Origin or whatever, then reload the page and try voting, you will see the page reload. But thread collapsing won't work at all.
while media _shouldn't_ run arbitrary code, there's also nothing stopping a malicious actor from crafting something that breaks through a buffer overflow in the .mp4 codec for example
the safest bet would probably be "assume anything can run arbitrary code, even if it's not supposed to"
https://opensource.adobe.com/dc-acrobat-sdk-docs/acrobatsdk/...
https://opensource.adobe.com/dc-acrobat-sdk-docs/acrobatsdk/...
Preferrably in useful work. The fact that end user interfaces are sometimes slower than what they were in the late 90s suggests this is often not the case.
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!"
I'm on Firefox and as soon as I click the link from the blog, it's just forever loading.
"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?
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...