well there you are… after experimenting with multiple Capacitor settings, the final solution was just to use the native Capacitor Http plugin that bypasses all CORS.
It is already built in Capacitor core, so you just have to enable it.
So just edit capacitor.config.json in your project root and add the plugins section as below.
{
"appId": "com.example.app",
"appName": "helloworld",
"webDir": "www",
"bundledWebRuntime": true,
"plugins": {
"CapacitorHttp": {
"enabled": true
}
}
}
That is all! No more CORS options needed!
Will see if we can auto enable that in all capacitor mobile projects.
More info at: