Earlier quoted context omitted.
It's like an image containing its own SHA2 hash. How is it possible?
Clever use of Javascript. a=document.querySelector('a');LZMA.compress(a.outerHTML,9,function(r){a.innerText=a.href='https://itty.bitty.site/#/?'+btoa(String.fromCharCode.apply(null,new Uint8Array(r)))})
Itty Bitty: Sites contained within their own links
91–100 of 111 posts
Re: Itty Bitty: Sites contained within their own links
#92Earlier quoted context omitted.
Browsers have offline capabilities that are currently massively underutilized. You can store the LZMA scripts in IndexDB perhaps?
Unfortunately that comes with a bootstrapping problem: what if the first time you hit the link is when you aren't connected? If everything is embedded in the data URI and the link is in fact the data itself then it doesn't matter.
Re: Itty Bitty: Sites contained within their own links
#93Earlier quoted context omitted.
Unfortunately that comes with a bootstrapping problem: what if the first time you hit the link is when you aren't connected? If everything is embedded in the data URI and the link is in fact the data itself then it doesn't matter.
I think that's an acceptable requirement. After all, you wouldn't expect an app to work without downloading it. If instead of using lzma, gzip were used, I bet you'd be able to include some code that would unzip itself using the browser's unzip capability. I am not sure how much code that would take though.
Re: Itty Bitty: Sites contained within their own links
#94A quine: https://itty.bitty.site/#/?XQAAAAIPAQAAAAAAAAAeGEPDwwAoaS2Sj...
nice! how did you do it?
Re: Itty Bitty: Sites contained within their own links
#95I do something similar in a bookmarklet to give myself a nice looking notepad. It's essentially a padded content editable div, with a prepopulated H1. This lets me print it out or save it as a document when needed. Which is never.
data:text/html,
That's one of my favorite "stupid HTML tricks". I wonder who first figured it out? I can't find the original blog post (if it even was) and now it's a known thing:
https://news.ycombinator.com/item?id=6005295
https://www.simonewebdesign.it/how-to-make-browser-editor-wi...
etc...
Re: Itty Bitty: Sites contained within their own links
#96Re: Itty Bitty: Sites contained within their own links
#97Earlier quoted context omitted.
What would such a cross-site scripting vuln do? There isn't anything to steal. Moreover you wouldn't use this for anything where you aren't in control of where people get the links from, because as soon as someone else starts sharing it they can of course edit it too.
The trustworthiness of the domain name would effectively be stolen.
Have a look at https://fiddle.jshell.net/pvcL4mjh/1/show/light/
Would you call that XSS / did I just steal JSFiddle's trustworthiness?
Re: Itty Bitty: Sites contained within their own links
#98Earlier quoted context omitted.
OK so you keep following the links (by copying and pasting into your address bar) and after about four links it says "oh hi ". Explain yourself! How did you do this?! Impressive!
Simple! 0. Write oh hi :D, get link0 1. Paste link0, get link1 2. Paste link1, get link2 ... Encoding goes E(T), E(E(T)), etc. let K be the per-char encoding overhead, so E(T) = KT: complexity is O(K^N * T) where N is number of levels and T is length of text at level 0!
Re: Itty Bitty: Sites contained within their own links
#99What is required to run this on own web server? Is there something else to it, such as node?