Fix PWA install: static manifest.json + proper SVG icon
- Replace blob: manifest (ignored by Chrome) with static manifest.json - Replace data: URL icon with real icon.svg file - Link manifest and apple-touch-icon directly in <head> - Remove blob/data URL generation from app.js Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
042ce0b095
commit
56c5662a11
7 files changed
+58
-11
No files matched your search
@@ -1251,14 +1251,6 @@ async function loadArtists(){
|
||||
|
||||
// ─── PWA ───
|
||||
function injectPWA(){
|
||||
const m={name:'NovaSonic',short_name:'NovaSonic',description:'Subsonic/Navidrome Music Client',
|
||||
start_url:'index.html',display:'standalone',background_color:'#07070f',theme_color:'#07070f',
|
||||
icons:[{src:"data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><rect width='100' height='100' rx='20' fill='%23e8a020'/><text y='.9em' font-size='70' x='15'>♫</text></svg>",sizes:'192x192',type:'image/svg+xml'}]};
|
||||
try{
|
||||
const blob=new Blob([JSON.stringify(m)],{type:'application/json'});
|
||||
const link=document.createElement('link');link.rel='manifest';link.href=URL.createObjectURL(blob);
|
||||
document.head.appendChild(link);
|
||||
}catch{}
|
||||
if ('serviceWorker' in navigator) {
|
||||
navigator.serviceWorker.register('sw.js').catch(() => {});
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user