Skip to main content
Topic: [ADDON] Elk Progressive Web App (Read 2279 times) previous topic - next topic - Topic derived from Elk Progressive Web App
0 Members and 1 Guest are viewing this topic.

[ADDON] Elk Progressive Web App

Here is a packaged version of a PWA. This is an early prototype. It lacks refinement for sure. Feel free to ask questions or make suggestions. Your forum must be installed in the root directory. It won't work in a subdirectory.

Use of a PWA requires use of https. If your site isn't already secure, this is a great opportunity to make the upgrade. People are increasingly privacy concerned - and users will hold higher confidence in your site. Https certificates can now be issied for absolutely free. Explore "Let's Encrypt" for further information regarding your particular server setup.

The service worker is actually quite robust. It can store pages for offline viewing, including images! Note pages visited are stored in the cache.

This should work on Android with Chrome or FF. It may work on ios. I have no means to test or verify.

Please test and critique. This is my first attempt at a packaged mod. Thanks!

Much customization is possible. Desktop icons may be changed by replacing existing icons in /elk_pwa folder. The filename must remain the same and the image must be a square png image, with sides matching the file name. ex: 144.png must be a 144x144px image.

The bar color may be changed in PWA.subs.php file in the sources folder. Simply replace the value of $theme_color with a hex color code. Also match it in the manifest.json file as well.

The description and title may be altered in the manifest.json file in the root folder.

To use: simply upload the zip to the package manager. Install. It is hook based so no core code alterations. Modify as outlined above as you see fit. Restart php and apache/nginx. Open your device's browser. Empty the cache for your site. Surf your site a few minutes. If everything is working, users should be invited to Add to Home. Now it will behave much like a native app!

Enjoy!!


Last Edit: November 20, 2020, 05:06:56 pm by badmonkey

Re: [ADDON] Elk Progressive Web App

Reply #1

Here is the second iteration: version 1.0.1.

Changelog: the manifest file is automatically created upon package install using forum name in the app title and description.
Last Edit: November 20, 2020, 05:46:10 am by badmonkey

Re: [ADDON] Elk Progressive Web App

Reply #2

Thank for releasing this, I install it today on my forum and nothing to report, it does what it says! ;)

Once installed, I was a little confused, I thought there were some setting in ACP, but nothing, it only needs to be installed.
For those who are using a different language than english there are some phrases to translate in offline.php (it's in the root of your forum).
sorry for my bad english

Re: [ADDON] Elk Progressive Web App

Reply #3

Quote from: radu81 – Thank for releasing this, I install it today on my forum and nothing to report, it does what it says! ;)

Once installed, I was a little confused, I thought there were some setting in ACP, but nothing, it only needs to be installed.
For those who are using a different language than english there are some phrases to translate in offline.php (it's in the root of your forum).
 
 Thanks for the feedback radu. I've been contemplating an ACP section as a vector for customization. I may work on that soon. Thanks for the feedback!

 

Re: [ADDON] Elk Progressive Web App

Reply #4

I had to disable it, I got some reports from my users which I can confirm:
  • Quick edit button does not work anymore (it says Loading but nothing happens)
  • when I upload attachments I get an error, attachments are uploaded correctly if I post the message
Tested with Firefox for Win10
sorry for my bad english

Re: [ADDON] Elk Progressive Web App

Reply #5

Quote from: radu81 – I had to disable it, I got some reports from my users which I can confirm:
  • Quick edit button does not work anymore (it says Loading but nothing happens)
  • when I upload attachments I get an error, attachments are uploaded correctly if I post the message
Tested with Firefox for Win10
 
 Interesting. I'll investigate. Thanks!

Re: [ADDON] Elk Progressive Web App

Reply #6

Could be related to some add-ons I use:
- for quick edit : Double post stopper which disables the quick reply and quick edit for latest poster in topic
- for attachments: Resize Attachments & Smush.it Image Attachments (IIRC you are also using both)

sorry for my bad english

Re: [ADDON] Elk Progressive Web App

Reply #7

I use attachment resize. It doesn't appear (yet) add ons are the issue. At the moment I think the service worker breaks ajax for some reason. More to come....

Re: [ADDON] Elk Progressive Web App

Reply #8

Hopefully this version resolves the issue.

V1.0.2
Changelog: added meta tag for content security policy to upgrade insecure requests

Recommended: uninstall old version, install this version. Restart nginx/apache/litespeed and php.

PWAs rely on heavy caching. If you still experience issues, try emptying browser cache. If that still doesn't work, uninstall the PWA from your device and reinstall (note: the browser should update automatically since there is a new version number. However, during testing it has become apparent it may occasionally fail. This is an issue inherent to browsers and caching rather than the mod itself)

Please test and report! And enjoy!

Thanks again for the report @radu81
Last Edit: November 20, 2020, 05:07:21 pm by badmonkey

Re: [ADDON] Elk Progressive Web App

Reply #9

I will surely test it this weekend, thanks for the update.

Spoiler (click to show/hide)
sorry for my bad english

Re: [ADDON] Elk Progressive Web App

Reply #10

Great suggestions radu, thanks! It's probably ideal attaching the package to the first post. As I'm typing away on a mobile, I'll leave it on the current post until the laptop is available again. Lol!