Capacitor is telling me
[error] - [App] Service worker registration failed: TypeError serviceWorker.register() must be called with a script URL whose protocol is either HTTP or HTTPS {}
but obviously the protocol in a capacitor app is capacitor://…
So how can I register service workers in a capacitor app?
Actually all I want is to intercept every single request, and if it is a same-origin request, handle it with custom behaviour depending on the path. For example <img src="/media/image.png"> should load the image from https://mywebsite.com/media/image.png instead of from capacitor://localhost/media/image.png