From aeab334bdfb3d2c594ef70974a9c37c9c7d65925 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 20 Jun 2026 11:16:00 +0000 Subject: [PATCH] Replace Memo demo with a URL-payload WebApp Shell MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Guts the notes app and turns the project into an offline-first shell that renders self-contained HTML encoded into the URL — a successor to opening data:text/html;base64 URLs from iOS Shortcuts, but on a real, persistent origin. - index.html: reads base64url HTML from the URL hash (#app= / gzip #appz=), decodes it (optional gzip via Compression Streams), and renders it full-screen in an iframe. When no payload is present, shows a builder UI to paste HTML and generate/copy/open a launch link. Auto-injects apple-mobile-web-app-capable + viewport metas. Includes a persistent- storage demo app. - Hash carries the payload so it never hits the server (no length/routing limits) and the service worker always matches the cached shell -> any generated link works fully offline after first load. - sw.js: precache shell, cache-first with ignoreSearch + navigation fallback so /webapp-shell/#... and ?... resolve offline; cross-origin requests pass through to the network. - manifest: renamed to WebApp Shell, dark theme. - icons: new code-bracket glyph (svg + regenerated pngs). - README: usage, Shortcuts/Home Screen steps, webapp:// explanation, offline + security notes. Co-Authored-By: Claude Sonnet 4.6 Claude-Session: https://claude.ai/code/session_01RTeJvsfW1JMs5fbP7AMYEz --- README.md | 77 ++++ icon-192.png | Bin 861 -> 1019 bytes icon-512.png | Bin 3824 -> 3601 bytes icon.svg | 10 +- index.html | 964 +++++++++++++++---------------------------- manifest.webmanifest | 15 +- sw.js | 53 ++- 7 files changed, 475 insertions(+), 644 deletions(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..a0d4207 --- /dev/null +++ b/README.md @@ -0,0 +1,77 @@ +# WebApp Shell + +A tiny, offline-first **PWA shell** that renders self-contained HTML pages encoded +directly into the URL. It's a successor to opening `data:text/html;base64,…` URLs +from iOS Shortcuts — but on a real, persistent origin. + +**Live:** https://appshr.github.io/webapp-shell/ + +## What it does + +1. Open the shell. Paste a self-contained HTML page into the builder. +2. It encodes your HTML (base64url, optionally gzip-compressed) into a link like: + ``` + https://appshr.github.io/webapp-shell/#app= + https://appshr.github.io/webapp-shell/#appz= + ``` +3. Opening that link renders your page full-screen inside the shell. + +## Why it beats raw `data:` URLs + +| | `data:` URL | WebApp Shell | +|---|---|---| +| Runs offline | yes | yes (service worker) | +| Persistent `localStorage` / `IndexedDB` | ❌ opaque origin | ✅ real origin, survives launches | +| Add to Home Screen (full-screen) | ❌ | ✅ | +| Stable, shareable URL | ❌ | ✅ | + +## The payload lives in the URL **hash** (`#`), on purpose + +- The hash is **never sent to GitHub's servers**, so there are no URL-length or + routing limits, and the service worker always matches the cached shell — + meaning **any generated link works fully offline** after the first load. +- Encoding is **base64url** (`-`/`_`, no padding) so it's URL-safe everywhere. +- With gzip (Safari 16.4+) the link stays much shorter. + +## Using it from Shortcuts + +1. Generate a link in the builder and **Copy** it. +2. Add an **“Open URLs”** action in Shortcuts and paste the link. +3. Running the shortcut opens your app in Safari — offline, with its data intact. + +> Shortcuts opens URLs in Safari (with its minimal toolbar). iOS does **not** +> allow Shortcuts to launch directly into a chrome-free standalone window — that's +> an OS limitation, not something a web page can change. + +## True full-screen (no Safari chrome) + +1. Open your app link, then in Safari tap **Share → Add to Home Screen → Add**. +2. The icon launches your app full-screen, offline, with its own storage. + +The shell auto-injects `apple-mobile-web-app-capable` and a `viewport` meta if your +page is missing them, so any pasted page becomes full-screen-capable. + +## Why not `webapp://`? + +Custom URL schemes can only be claimed by **native** apps on iOS (via Info.plist). +A web page / PWA cannot register `webapp://`, so it can never be launched that way. +The `https://` links this tool generates do everything that scheme was meant to do. + +## Offline guarantee + +The first online load caches the shell permanently via a service worker. After that +the shell and every link work with no network. Your app only needs the internet if +**its own code** fetches something external — keep pages self-contained to stay 100% offline. + +## ⚠️ Security note + +Anything you load runs on the `appshr.github.io` origin with full access to its +storage. Only open links you created or trust: a malicious page could read or wipe +the data of your other shell apps. + +## Files + +- `index.html` — the shell (renderer + builder UI) +- `sw.js` — service worker (offline cache) +- `manifest.webmanifest` — PWA manifest +- `icon.svg`, `icon-192.png`, `icon-512.png` — icons diff --git a/icon-192.png b/icon-192.png index bc5d3a7fc7a65b04541aa3aac4858b26996f1ee4..c07c78842d3d73f22e9338f9d5b5c6c0c795b9af 100644 GIT binary patch literal 1019 zcma)4ZA@EL7=G{VU3;xyZ$&e@&Gqt;fXiGMFl9K~%a^PyQbP6v6EknZ@XtQHMiD5b zw=|g*fk85mX&6Ok#y%ntKSHzN*230d(M)FI=2p_`4eC0CmXEgJE%mhgH|EXrKF@Q` zdrtD6^R`u0mM6=%$pIi)cd)b?u_F#rigLB*xC}rtp(`yq-1y+{S>4GUx@WdHYaV;9 zzVyV2Z-0E=WLF02zs|5J_Z{v1<-z=)cf2Ar?Zk!uLx*Nfad?WH4(k#+7NLL{~ zh?qfKfHS*rE(fXXgrbp3#hG~cfuoQkH{E~dhLu=X9!Bpsl8|HC1ON^lYV-iyNdOv- zY!eoM!F<8A%I#VLJer%c&^Sdn{_3MgATW-ZXY`DB{jmarv1G0gNU-M*qyU4?Lu#x~ zXcFf1B;0>Lzacu72COHtXxbvfVW&EFnvXV!yu=aFHZ5W}xRQiRUc|2+(3qCO0Ot7! zs{cnhzIu(Jq@&BX_~mdbO|s!E%NgkJU{$eS1uHFOCr%B#=bd>(Ld1vbo5Ly)wEio4 zx`1-@v=^?me3+u#Ei9VWo+V^(Hgt0#6SC+Umv_TIS!k&fPe45}EttT4NA_`WJFjx) zB28AqDD^m|U z&pij%MK`+882v0L$q_#vFvM;sZk4biG*-_GUBKiJ=AadfEzVB0d1blvXXqbS#u%4m zE5F{X>lkfi{nNJL zeb9G1e>Eh#mujA_{nQ}oKlY?!ZtrW+K>IN{vot+I#0LSe(V0U-INj!G!n(_R{V;pgoYg-xq+@Sh-hN0=W~JV*{KD$B(XVo zAYlo2mm20UW^g5vR%H^YY^@1;WYBt7urh1Gl0h-COlND2Z*N`dGohhl^RuzYk-OQvd(} literal 861 zcmeAS@N?(olHy`uVBq!ia0vp^2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&j2lSFHc;(0HqzJ|U|4N#&sLv>+w-kW zq$CSk=36y1771sHD;UuwCnKZyqKkagcPNE0z`Tsd8ONtGgD)GOcZ-Boqdu z-LJ7dDAj4yw7ZvsBEd${7$24yHLdPx&@cOe7GuPn;w7w5Kn(7!rp2#-dw1e~`!Gt$ zbpqV59>%6`U&QwM5&CcqDG!6@dU=ZLI+*-zb+lLr+ZwPGR|A*=ts$g57!qafNHz^2 z0B6xc-_E&xy~xEzaK z4*|$C>Ln06%$>c^_E12yy$4Vfu6DzzFN6TG<~|JeZAXCE<+SlAd?CQ8`hRDCF3$M) zzIFKkv!3Pig3!JYPhDS>g*U2iH{)ktxxBs3X^n#E}E< zEHnzsj?F`h^gADSgo&xsI|GO+=FZ)kF6d#x;SpJ`6meCytGRjA+Z#(1cvZLQoVN=K=CrJz zbpKyeW+GeTgfW)~9=r+Qo>R?402Ml(dp)INzl+FTfIf$o-UY`Qj3={OL0triT$iU*2pN07xFBG8h8RjxD4*04#TX4o6A#6tFx#(e9Q4HCP$R zYEf`^_TZj4Fc~V}VzoSQ-?&Sv!@#0njeAnSGW-yWnczsBaj-S16%46KOFhCC X^q%zMN0-iXN)}|RGLuiND607zB6Mxz diff --git a/icon.svg b/icon.svg index a575502..c4bad7c 100644 --- a/icon.svg +++ b/icon.svg @@ -1,6 +1,8 @@ - - - - + + + + + + diff --git a/index.html b/index.html index e045661..e886642 100644 --- a/index.html +++ b/index.html @@ -4,696 +4,416 @@ + - - - - Memo — Quick Notes + + + WebApp Shell - - - - -
- - - -
-
- - - - -