filips123 / PWAsForFirefox

A tool to install, manage and use Progressive Web Apps (PWAs) in Mozilla Firefox
https://pwasforfirefox.filips.si
Mozilla Public License 2.0
2.17k stars 50 forks source link

Option to update Icon URL every day automatically? #510

Open noahdominic opened 3 months ago

noahdominic commented 3 months ago

Problem Description

Hi, there are some web apps that change their icons every day. Is it possible to replicate it currently? For example, Notion Calendar (previously Cron) changes its favicon depending on the day it currently is. If it's 9 June, it displays a '9' calendar icon; the next day it displays a '10' icon. I would like to replicate this behaviour for the app icons as well.

Proposed Solution

If it isn't currently possible to replicate, I would propose an option to update web app icons depending on some triggers (at browser launch, etc). I'm imagining a checkbox in the 'Edit web app' page saying something like 'Automatically fetch new web app icons on browser launch'.

Cheers!

filips123 commented 2 months ago

You can probably currently achieve that if you add some cron job/scheduled task to run firefoxpwa site update <ID> every day.

I'm not sure about automatically updating manifest info (name, description, icons, shortcuts). If they were updated at launch, this could delay the startup if the runtime waited until the manifest is updated. If the manifest got updated in parallel while launching the PWA, there might be a mismatch between the old info (that the current instance would use) and the updated info. Also, automatically changing app name and icons might have security implications.

Apparently, Chrome tries to update the manifest at launch, but at most once per 24 hours (source). I guess that this could partially solve issues with slow start (well, at least make them less noticeable), but it probably complicates things (as the program needs to store the last time the manifest was checked), and also wouldn't work with dynamic icons (as the old icon could remain for up to 24 hours). And, well, Chrome doesn't even support updating PWA name and icons...