Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate making wiki installable as a web-app #141

Closed
SirLich opened this issue Jul 26, 2021 · 1 comment · Fixed by #504
Closed

Investigate making wiki installable as a web-app #141

SirLich opened this issue Jul 26, 2021 · 1 comment · Fixed by #504
Labels
JS/VUE Issues pertaining to JS or VUE question Further information is requested
Milestone

Comments

@SirLich
Copy link
Contributor

SirLich commented Jul 26, 2021

Is this possible with our setup? Any disadvantages?

@SirLich SirLich added question Further information is requested JS/VUE Issues pertaining to JS or VUE labels Jul 26, 2021
@SirLich SirLich added this to the v1.1 Release milestone Jul 26, 2021
@Fabrimat
Copy link
Contributor

Fabrimat commented Sep 19, 2022

Making a PWA is pretty simple and shouldn't have any disadvantages.
The only needed things are a manifest manifest.json and a service worker sw.js which could also be used for caching if needed.

More info:
https://web.dev/add-manifest/
https://web.dev/learn/pwa/service-workers/

Manifest:

{
    "name": "Bedrock Wiki",
    "short_name": "Bedrock Wiki",
    "theme_color": "#171717",
    "background_color": "#262626",
    "display": "standalone",
    "scope": "/",
    "start_url": "/",
    "icons": [
      {
        "src": "./assets/images/homepage/wikilogo.png",
        "sizes": "256x256",
        "type": "image/png"
      }
    ],
    "splash_pages": null
  }

Service worker:

self.addEventListener("install", event => {
   console.log("Service worker installed");
});
self.addEventListener("activate", event => {
   console.log("Service worker activated");
});

And then somewhere it will always be executed:

if ('serviceWorker' in navigator) {
  navigator.serviceWorker
    .register('sw.js?v=0.1');
}

I could do a PR in the near future with everything needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
JS/VUE Issues pertaining to JS or VUE question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants