We have an application that has multiple whitelabel solutions for clients - meaning they are hosted under their own domain.
We have one Cordova app and we want that users can visit all these sites with this app, but I don't want to redeploy everytime we sign a new client.
- is there a way to get to load the whitelist through a url or something? This would mean we can add domains on the fly through our database.
- is there a huge security risk when you whitelist all urls?
https://cordova.apache.org/docs/en/latest/guide/appdev/whitelist/
Example
To clarify, I would love to have something like a URL that you can point to where it loads everytime on startup the whitelist settings.
http://myexampledomain.com/whitelist.config
<allow-navigation href="*.myexampledomain.com/*" />
<allow-navigation href="*.subdomain.someclientdomain.com/*" />
<allow-navigation href="*.subdomain.someclientdomainb.com/" />
<allow-navigation href="*.subdomain.someclientdomainc.com/" />
...this file would be automatic loaded on startup.
Creating a JS based plugin
If there's not current solution, is it possible to do this safe by creating a (JavaScript based) Cordova plugin? Like manually redirecting when the URL we try to load is outside a whitelist?
This means we would Cordova-whitelist everything and use our own plugin to block out everything outside our own whitelist.
(I am aware this is not safe when our database is compromised, but in that case we have bigger problems in general. Our app is for fun and does not rely on critical functionality)