feat(pwa): add service worker and scope for full PWA installability
CI / Build & Test (push) Successful in 3m1s
CI / Build & Test (push) Successful in 3m1s
Add a minimal sw.js with an empty fetch handler — required by Chrome for the PWA install prompt to appear. Register it at the bottom of dashboard.html with a silent catch. Add "scope": "." to the manifest. Register sw.js in web_accessible_resources so Chrome can fetch it from the extension origin.
This commit is contained in:
@@ -1293,5 +1293,12 @@
|
||||
|
||||
<!-- Entry point (runs init()) -->
|
||||
<script src="core/init.js"></script>
|
||||
|
||||
<!-- PWA service worker registration (required for installability) -->
|
||||
<script>
|
||||
if ('serviceWorker' in navigator) {
|
||||
navigator.serviceWorker.register('sw.js').catch(() => {});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"short_name": "Holesail",
|
||||
"description": "P2P Holesail tunnels in the browser",
|
||||
"start_url": "dashboard.html",
|
||||
"scope": ".",
|
||||
"display": "standalone",
|
||||
"display_override": ["window-controls-overlay", "standalone"],
|
||||
"background_color": "#0f1117",
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
// Minimal service worker required for PWA installability.
|
||||
// No caching is needed — the extension bundle is already local.
|
||||
self.addEventListener('fetch', () => {});
|
||||
@@ -54,6 +54,7 @@
|
||||
"wrong-domain.html",
|
||||
"dashboard/dashboard.html",
|
||||
"dashboard/manifest.webmanifest",
|
||||
"dashboard/sw.js",
|
||||
"dashboard/screenshots/*.png",
|
||||
"dashboard/dashboard.css",
|
||||
"dashboard/data/*.js",
|
||||
|
||||
Reference in New Issue
Block a user