TLDR: App uses webview to load page from file. Serviceworkers only work via http. Searching for a solution to get serviceworkers running. Preferably not by compiling my own webserver into the app.
I am currently trying to get a serviceworker running in an app that utilizes WebView. (The hydrogen matrix chat client)
The problem is, that serviceworkers are not allowed when the page is served via the file:
protocol.
An app for ubuntu touch solved this by spinning up a small http server which serves the file locally.
For an ecosystem however it does not sound nice, when every other app brings their own webserver just to solve this problem. Imagine there is a critical security issue with this server and every application that ships it to solve a common problem needs to be patched… That would result in more app nightmares that we already have with outdated apps.
The next question would be, if that is actually allowed in the store.
Does anyone have ideas to do that better? Either circumvent the local webserver entirely, or a solution provided by the platform.
Followup question: if I am shipping my own webserver, what do I need to look for? Its basically only serving once files at app startup, so I’d want something which is not eating resources afterwards.