Add PWA manifest and SW
All checks were successful
Build & Release / build-docker-image (push) Successful in 1m51s
Build & Release / deploy-to-production (push) Successful in 8s

This commit is contained in:
2026-04-10 21:08:45 +02:00
parent fdbde62a25
commit c14a86b190
5 changed files with 41 additions and 0 deletions

21
app/components/pwa.py Normal file
View File

@@ -0,0 +1,21 @@
import streamlit as st
init = st.components.v2.component(
name="pwa",
isolate_styles=False,
js = """
export default function() {
// Manifest
const link = document.createElement("link");
link.rel = "manifest";
link.href = "./app/static/manifest.json";
document.head.appendChild(link);
// Service Worker
navigator.serviceWorker.register('./app/static/service-worker.js')
.then(reg => console.log('SW registered', reg))
.catch(err => console.log('SW registration failed', err));
}
""",
)