Wikimedica / mediawiki-extensions-PWA

PWA extension for MediaWiki
GNU General Public License v3.0
2 stars 2 forks source link

Don't add link to manifest if MediaWiki:default-manifest.json is empty or in invalid format #2

Closed jdlrobson closed 2 years ago

jdlrobson commented 2 years ago

If MediaWiki:default-manifest.json does not exist, then the manifest tag should not be added to the page. I think it's possible admins might install the extension but forget about it, so it would be a good idea to add a check in there for Title existence.

Also not sure what to do if the manifest is in an invalid format. If I edit with {"invalid": true} it is still registered as the manifest but it triggers site warnings. Not sure if that should be treated as GIGO.

bitsofmymind commented 2 years ago

Fixed! As to validating the manifest, that would be quite complicated and it's already a task most browsers will do themselves and give warnings about in the developer console.