Itty Bitty: Sites contained within their own links
81–90 of 111 posts
Re: Itty Bitty: Sites contained within their own links
#82Earlier quoted context omitted.
My mind immediately went to stuff like tickets. Can't say how many times I've gotten stuck having my ticket checked at a concert or on a train simply because there's no connectivity and the page is no longer in cache on my phone. If all the data is in the URI then it could work as an option for entirely static data. I'd say this is useful for almost anything that fits in a one page PDF.
How does that solve the no connectivity problem? You’d still need the site (with rendering scripts) cached.
Re: Itty Bitty: Sites contained within their own links
#83So from Content Lengths [0]... You've tested on Chrome, and IE, but not Firefox? [0] https://itty.bitty.site/#Content_Lengths/XQAAAAIXAwAAAAAAAAA...
Re: Itty Bitty: Sites contained within their own links
#84A quine: https://itty.bitty.site/#/?XQAAAAIPAQAAAAAAAAAeGEPDwwAoaS2Sj...
Re: Itty Bitty: Sites contained within their own links
#85https://itty.bitty.site/#/?XQAAAALfAAAAAAAAAAA0HSzgdXPvDK5AE...
Re: Itty Bitty: Sites contained within their own links
#86Re: Itty Bitty: Sites contained within their own links
#87The data URI scheme is standard and widely supported, does not rely on the host bitty.site being reachable and does not need JavaScript. One can even create data URIs with a small shell script that is given a filename argument:
#!/bin/sh -eu
printf 'data:%s;base64,%s' "$(file -bi "$1"|tr -d ' ')" "$(base64 -w 0 "$1")"Re: Itty Bitty: Sites contained within their own links
#88Earlier quoted context omitted.
My mind immediately went to stuff like tickets. Can't say how many times I've gotten stuck having my ticket checked at a concert or on a train simply because there's no connectivity and the page is no longer in cache on my phone. If all the data is in the URI then it could work as an option for entirely static data. I'd say this is useful for almost anything that fits in a one page PDF.
How does that solve the no connectivity problem? You’d still need the site (with rendering scripts) cached.
Seeing as tickets are typically sent in HTML emails anyway the scary looking URI can just be hidden behind a nice anchor tag or something anyway. When the recipient clicks the link, the page will open in a browser and render just fine without any connectivity. Graphics can be embedded in the same way, using `data:` URIs as image tag sources, or in embedded css.
Here's an example, turn off your connection and try this in your browser's address bar:
data:text/html;charset=utf-8;base64,PG1ldGEgY2hhcnNldD0idXRmLTgiPjxtZXRhIG5hbWU9InZpZXdwb3J0IiBjb250ZW50PSJ3aWR0aD1kZXZpY2Utd2lkdGgiPjxiYXNlIHRhcmdldD0iX3RvcCI+PHN0eWxlIHR5cGU9InRleHQvY3NzIj5ib2R5e21hcmdpbjowIGF1dG87cGFkZGluZzoxMnZtaW4gMTB2bWluO21heC13aWR0aDozNWVtO2xpbmUtaGVpZ2h0OjEuNWVtO2ZvbnQtZmFtaWx5OiAtYXBwbGUtc3lzdGVtLEJsaW5rTWFjU3lzdGVtRm9udCxzYW5zLXNlcmlmO3dvcmQtd3JhcDogYnJlYWstd29yZDt9PC9zdHlsZT4gSGVsbG8sIEx4ciBmcm9tIEhOIQ==
EDIT: Created another, more complex, example but it's unfortunately too long for HN comments. You can see it here:https://gist.github.com/mstade/597f7da82841b1c27c63c8b383538...
Just copy and paste the raw contents of that file into the address bar and it should render the page.
Re: Itty Bitty: Sites contained within their own links
#89Earlier quoted context omitted.
How does that solve the no connectivity problem? You’d still need the site (with rendering scripts) cached.
Browsers have offline capabilities that are currently massively underutilized. You can store the LZMA scripts in IndexDB perhaps?
Re: Itty Bitty: Sites contained within their own links
#90E.g. this one cribbed from StackOverflow:
data:text/plain;base64,SGVsbG8sIHdvcmxkISBJJ20gZG93bmxvYWRlZCB2aWEgImRhdGE6dGV4dC9wbGFpbjsuLi4iIFVSTCB1c2luZyA8YSBkb3dubG9hZD0iZmlsZV9uYW1lIi4uLj4uDQpNeSBiaXJ0aHBsYWNlOiBodHRwOi8vc3RhY2tvdmVyZmxvdy5jb20vcXVlc3Rpb25zLzY0Njg1MTcvDQoNCk1vcmUgYWJvdXQ6DQpodHRwOi8vd3d3LnczLm9yZy9UUi9odG1sL2xpbmtzLmh0bWwjYXR0ci1oeXBlcmxpbmstZG93bmxvYWQNCmh0dHA6Ly93d3cudzMub3JnL1RSL2h0bWwvbGlua3MuaHRtbCNkb3dubG9hZGluZy1yZXNvdXJjZXMNCg0KQnJvd3NlciBzdXBwb3J0OiBodHRwOi8vY2FuaXVzZS5jb20vZG93bmxvYWQ=