`gap` prompts alerts bypass

I’ve been trying to load my android cordova app via webserver. Already tried to change my <content src= /> to the webserver IP but I end up without the cordova/cordova-plugins functionality.

Another of my tries was remaining with the <content src="index.html" /> and change the CSP on index.html. I’ve tried different CSP but none of them worked, either they show the gap prompts alerts or they don’t show anything but yet the plugins are not loaded.

Used something like <meta http-equiv="Content-Security-Policy" content="default-src * gap://ready data:; img-src * 'self' data:; style-src * 'unsafe-inline'; script-src * 'self' 'unsafe-inline' 'unsaf"> without success.

My main goal is to load my cordorva app with its plugins features available via a webserver, like http://192.168.1.9:8000/mypage/ - or even through cordova serve . Another important note is that I need such functionality because I’m looking forward to open the app on a standard chrome webview (android).

I understand about the security guidelines by Google, etc. but this will be used for a paper and not released on any prod. Thus avoiding any break of rules or something.

Anyone has tips I can follow to accomplish this?

Thanks.

1 Like

Are you able to solve this problem?

I was facing the same problem and fixed by running ionic build --base-href=/my-app-location/ instead of ionic cordova buid <platform> --base-href=/my-app-location/ and then change the <base href="/"> from the created index.html to <base href="./" />.

Maybe this code can inspire you as it allows u to create a cordova container that pulls web assets from other servers

U need to work on config.xml for that

And not sure if such architecture at all complies with app store TOS