Ylianst / MeshCentral

A complete web-based remote monitoring and management web site. Once setup you can install agents and perform remote desktop session to devices on the local network or over the Internet.
https://meshcentral.com
Apache License 2.0
4.09k stars 549 forks source link

create mainfest.json for PWA #4491

Closed si458 closed 1 year ago

si458 commented 2 years ago

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"
  }]
}
Ylianst commented 2 years ago

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.

si458 commented 2 years ago

@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?

phorcys420 commented 2 years ago

~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/

dxdemetriou commented 2 years ago

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)

phorcys420 commented 2 years ago

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.

dxdemetriou commented 2 years ago

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.

si458 commented 1 week ago

https://github.com/Ylianst/MeshCentral/commit/0bee2be3cfc15b9c54a8d43e8d19a41dce28dd86