Source
This app’s code and revision history are public. Download a copy or explore the files below.
Public
The app’s code and revision history are public.
Run it yourself
Take the whole tree and run it on your own machine. The download needs no account. Cloning needs a sign-in.
Download .zip
bounded clone 23e397d8a5d5bf7756362640
A copy you download is not bounded. The guarantees this app runs under - declared egress, proven invariants, writes that fail closed - live in the runtime serving this page, not in the files. What you get is auditable source you can read and run, with no runtime guarantees attached.
src/sw.js
// Lift's service worker. It keeps the app on the device, so Lift opens and logs sets with no
// connection at the gym once it has loaded. The log syncs to the account when the connection is back.
// The build (vite.config.ts) fills in the version and the list of files.
const CACHE = "lift-shell-__VERSION__";
const SHELL = __SHELL__;
self.addEventListener("install", (e) => {
e.waitUntil(caches.open(CACHE).then((c) => c.addAll(SHELL)).then(() => self.skipWaiting()));
});
self.addEventListener("activate", (e) => {
e.waitUntil(
caches.keys()
.then((keys) => Promise.all(keys.filter((k) => k.startsWith("lift-shell-") && k !== CACHE).map((k) => caches.delete(k))))
.then(() => self.clients.claim()),
);
});
self.addEventListener("fetch", (e) => {
const req = e.request;
const url = new URL(req.url);
if (req.method !== "GET" || url.origin !== location.origin || url.pathname.startsWith("/__bounded/")) return;
if (req.mode === "navigate") {
// Every page is the same app: fresh when online, the saved copy when not.
e.respondWith(
fetch(req)
.then((res) => {
if (res.ok && (res.headers.get("content-type") || "").includes("text/html")) {
const copy = res.clone();
void caches.open(CACHE).then((c) => c.put("/", copy));
}
return res;
})
.catch(() => caches.match("/", { cacheName: CACHE, ignoreVary: true })),
);
return;
}
e.respondWith(caches.match(req, { cacheName: CACHE, ignoreSearch: url.pathname === "/", ignoreVary: true }).then((hit) => hit || fetch(req)));
});
Change history
Point OpenApps store links to openapps.free
Add favicon.ico, local share image and openapi.json for links and guides
Bind agent address in policy constants
Add OpenApp contribution strip and OpenApps source links
Bounded source sync
Bounded source sync
Bounded source sync