Progressive Web Apps (PWA)

August 14, 2026 · View on GitHub

Installable, offline-capable PyScript apps are a major pydevices-examples feature — the same PSDisplay demos you open in a browser tab can be installed like a native app on phones, tablets, and desktops.

Live gallery (already a PWA): pydevices.github.io/pydevices-examples/pyscript/

How to build one: Make your PyScript app a PWA — this page is about where those apps run and how install UX differs by host.


What you get

CapabilityNotes
In-browserTab or window — no install required
InstallableHome screen / app launcher icon when the host supports it
Standalone windowChromium display: "standalone" hides browser chrome after install
Offline (after first visit)Service worker caches shell + runtime; run each demo once online so WASM/packages land in cache
Same PythonMicroPython or Pyodide via PyScript; drawing still goes through PSDisplay

A PWA is still a website on HTTPS. Python runs inside the page; the browser owns install, caching, and the launcher icon.


Where PWAs run

HostInstall UXTypical resultNotes
Chrome / Edge (Windows, macOS, Linux)Address-bar install icon or Install app; beforeinstallpromptStandalone app windowBest-supported desktop path
Chrome on AndroidInstall app / Add to Home screenLauncher icon; standalonePhone/tablet web install — not the same as the Android APK
Chromebook (Chrome OS)Same as desktop ChromeLauncher / shelf iconTreat as Chromium desktop
Safari on iOS / iPadOSShare → Add to Home Screen (no programmatic prompt)Home-screen icon; opens fullscreen-ish WebKitSee Apple mobile
Firefox / Safari (desktop)Limited or no Chromium-style install promptOften stays a bookmark / tabGallery still runs in-tab; install polish is Chromium-first
LG webOS / Samsung Tizen (TV browsers)Host web app / browser onlyIn-browser or platform web-app packagingWeb path only — no native SDLDisplay on TV OS shells

!!! tip "Try the live gallery" Open the PyScript gallery on the device you care about, then use that host’s install path from the table.


Install UX differences

Chromium (beforeinstallprompt)

Chrome and Edge (desktop and Android) can fire beforeinstallprompt. The gallery Install app button calls that API when available. Uninstall an earlier install of the same origin if the prompt never appears — browsers suppress it for already-installed scopes.

iOS / iPadOS (no install API)

Safari never fires beforeinstallprompt. The gallery button shows a short Share → Add to Home Screen tip instead. That is expected, not a bug.

Standalone vs browser tab

ModeWhat the user sees
TabNormal browser chrome; URL bar visible
Installed standaloneApp-like window; gallery keeps same-origin demo links in one window (Chromium would otherwise open a new app window for target="_blank")

Details and manifest/pwa.js behavior: PWA guide — wire pages.


Offline and storage

  1. Visit once online and click Run on a demo so PyScript/Pyodide (and packages) download.
  2. The service worker caches the shell and subsequent CDN/runtime responses.
  3. Later offline reloads work for cached assets; first-run or uncached demos still need the network.

Storage can reach tens to hundreds of MB. Prefer stale-while-revalidate over precaching every WASM blob — see the PWA guide.

Deploy-time CACHE_NAME hashing and the July 2026 legacy-cache migration are documented in Orphaned service workers and cache migration.


PWA vs native Android APK

PWA (this page)Android APK
RuntimePyScript in the browser / WebViewCPython in pydevices-android-template
DisplayPSDisplaySDLDisplay + usdl2
DistributionHTTPS URL + install/home screenPlay / sideload APK
Best forZero-install demos, cross-OS shareable links, offline galleryStore packaging, deeper device integration

Phone Android APK notes: Android platform guide. Android TV / Fire OS packaging is a separate pursue track on the org roadmap — still SDL/APK, not this PWA story.


Apple mobile (iOS / iPadOS)

There is no native iOS pydevices-examples app on the foreseeable roadmap. Apple phones and tablets use:

  • Mobile Safari (or another WebKit browser) → PyScript gallery in a tab, and/or
  • Add to Home Screen → installed PWA-style icon launching the same PSDisplay site.

That is the supported Apple mobile path: browser + optional home-screen install, not App Store packaging.


Smart TVs (webOS / Tizen)

LG webOS and Samsung Tizen ship Chromium-based browsers and encourage web apps. pydevices-examples’s TV story is the same PyScript/PSDisplay stack (large UI, remote keys) — not a native SDL build on those OS shells. A hosted gallery or TV web-app package can reuse the PWA assets; treat installability as host-specific.

Example: tv_remote_menu — large-row D-pad menu. Remote key notes: .site/pyscript/tv/README.md.

TV Back (BrowserBack / GoBack / Back) maps to keys.K_AC_BACK so PSDisplay.quit_chord matches Android remotes.

Native Android TV / Fire OS APKs are separate — see Android TV / Fire OS.


DocRole
PyScript platform notesBoard config, experimental status, contribution pointers
Make your PyScript app a PWAManifest, service worker, COI, deploy, troubleshooting
Portability & platformsFull runtime × target matrix
AndroidNative APK path (contrast with PWA)
Try pydevices-examplesLive demo links