feat(web): add network-only PWA installability (#6190)

* feat(web): add network-only PWA installability

Serve the manifest, registration script, network-only service worker, and icons under the runtime web base path so panels remain installable at arbitrary configured URLs.

This does not add offline caching or change panel, API, database, or Xray behavior.

* chore(docs): remove development planning notes

Keep the pull request focused on the PWA implementation, tests, and user-facing verification documentation.

* feat(web): adopt the 3X logo PWA icon set from #1865

Replace the two placeholder SVG icons with the six-size PNG set
(16/24/32/64/192/512) contributed by @Incognito-Coder in PR #1865.
The PNGs have transparent rounded corners, so the manifest entries
drop the maskable purpose claim and rely on the default any.

---------

Co-authored-by: korsun009 <277924786+korsun009@users.noreply.github.com>
Co-authored-by: Sanaei <ho3ein.sanaei@gmail.com>
This commit is contained in:
korsun009
2026-08-18 16:33:20 +03:00
committed by GitHub
parent 3f1dd4bf5a
commit 3a2f9b48da
16 changed files with 343 additions and 0 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 270 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

+41
View File
@@ -0,0 +1,41 @@
{
"name": "3x-ui",
"short_name": "3x-ui",
"start_url": "./",
"scope": "./",
"display": "standalone",
"background_color": "#0f172a",
"theme_color": "#1677ff",
"icons": [
{
"src": "icons/3x-ui-16.png",
"sizes": "16x16",
"type": "image/png"
},
{
"src": "icons/3x-ui-24.png",
"sizes": "24x24",
"type": "image/png"
},
{
"src": "icons/3x-ui-32.png",
"sizes": "32x32",
"type": "image/png"
},
{
"src": "icons/3x-ui-64.png",
"sizes": "64x64",
"type": "image/png"
},
{
"src": "icons/3x-ui-192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "icons/3x-ui-512.png",
"sizes": "512x512",
"type": "image/png"
}
]
}
+14
View File
@@ -0,0 +1,14 @@
(() => {
if (!('serviceWorker' in navigator)) return;
const script = document.currentScript;
if (!(script instanceof HTMLScriptElement)) return;
const scriptUrl = new URL(script.src, window.location.href);
const baseUrl = new URL('./', scriptUrl);
const workerUrl = new URL('service-worker.js', baseUrl);
navigator.serviceWorker.register(workerUrl.pathname, {
scope: baseUrl.pathname,
}).catch(() => {});
})();
+9
View File
@@ -0,0 +1,9 @@
self.addEventListener('install', (event) => {
event.waitUntil(self.skipWaiting());
});
self.addEventListener('activate', (event) => {
event.waitUntil(self.clients.claim());
});
self.addEventListener('fetch', () => {});