Capacitor is not defined after POSTs on Android

Capacitor v4, running an app that refreshes the entire page each page load (aka an old fashioned server side rendered web site). On Android, only after a POST submission, the Capacitor object is not defined. Everything works fine on iOS and for GET requests on Android. Do I need to do something to wait for the Capacitor object to be defined after a POST?

I did some digging into the code. In WebViewLocalServer, the function handleProxyRequest() appears to only do something for GET requests. Does this mean that POSTs to external webservers are not supported on Android?

After more looking through the code, it’s clear that Capacitor does not inject the javascript code necessary to expose the Capacitor object on POSTs to external webservers. It would be nice if this was documented somewhere, but in any case, I’m going to mark this as solved.

It seems there are two ways to work around this. You can figure out the javascript that’s injected on requests, and serve that by hand in these instances. Or you can intercept POST submissions and do them a different way (using fetch(), for example).