MeshCentral icon indicating copy to clipboard operation
MeshCentral copied to clipboard

create mainfest.json for PWA

Open si458 opened this issue 2 years ago • 6 comments

Is your feature request related to a problem? Please describe. currently creating a shortcut on android from firefox just opens firefox to the url, but if i create a shortcut for say librenms it opens the webpage like a full app seperate (powered by firefox)

Describe the solution you'd like if you create a manifest.json and serve it at the root of the website, it enables like an app for mobile devices, but also an app for the likes of chrome os

Describe alternatives you've considered currently creating a shortcut on android from firefox just opens firefox to the url

Additional context https://developer.mozilla.org/en-US/docs/Web/Manifest SAMPLE manifest.json

{
  "name": "(SITE TITLE) (SITE TITLE2)",
  "short_name": "(SITE TITLE)",
  "display": "standalone",
  "background_color": "#fff", // just allows for a white loading screen while opening
  "description": "full computer remote control", // wasnt sure what to put as needs to be short
  "icons": [{ // can add more icons if needs be
    "src": "favicon-303x303.png",
    "sizes": "303x303",
    "type": "image/png"
  }]
}

si458 avatar Sep 03 '22 06:09 si458

MeshCentral has had a manifest.json for a long time, in GitHub, it's here. It is also accessible from the root, so you can try accessing /manifest.json and it should work. This said, I am not an expert in this, maybe it's not correct.

Ylianst avatar Sep 03 '22 19:09 Ylianst

@Ylianst ahh yes my bad it is there indeed

~~however I believe its missing the header link in the index.html page~~

~~<link rel="manifest" href="manifest.json" crossorigin="use-credentials">~~

it's not working which is weird even though its their?

si458 avatar Sep 03 '22 22:09 si458

~however I believe its missing the header link in the index.html page~

You were right, it is missing the header link, hence why it does not suggest installation. Each browser has it's own criterias for suggesting PWA install though, so I recommend you check https://web.dev/install-criteria/

phorcys420 avatar Sep 06 '22 14:09 phorcys420

It couldn't be better to be tried by a project that's for this specific work instead of doing it from scratch? https://www.npmjs.com/package/create-pwa

It says: create-pwa can be used with existing applications or can be the first thing one does when starting a new app.

Also, the benefits of PWA is the cross-platform compatibility in places where Chromium browser runs, an example is the Microsoft Teams that it's going to be a PWA application on Linux instead of specific OS app ( I mean it's not just only for mobiles but a more headacne-free method for cross-platform compatibility)

dxdemetriou avatar Sep 11 '22 13:09 dxdemetriou

It couldn't be better to be tried by a project that's for this specific work instead of doing it from scratch? https://www.npmjs.com/package/create-pwa

Sure, but all create-pwa does is create manifests for it, which are just boilerplate that could be created by hand, that's fine by me but it would only be needed once is what I mean. And it would also be easier on the maintainers that are (visibly) unfamiliar with PWAs & save them some time.

phorcys420 avatar Sep 12 '22 20:09 phorcys420

It couldn't be better to be tried by a project that's for this specific work instead of doing it from scratch? https://www.npmjs.com/package/create-pwa

Sure, but all create-pwa does is create manifests for it, which are just boilerplate that could be created by hand, that's fine by me but it would only be needed once is what I mean. And it would also be easier on the maintainers that are (visibly) unfamiliar with PWAs & save them some time.

If it's one time only, surely it's not necessary to become as part of the project, but it could be a good start point to try it for testing just to see the necessary needed changes. Just the service-worker thing I didn't understood it yet, if it's one time only or if it's needed on every update especially for Android.

dxdemetriou avatar Sep 13 '22 04:09 dxdemetriou