I have added the CSP configurations frame-ancestors: 'self'
on webserver https://www.exapleA.com/test/.
Currently I have another Android Cordova app and using iframe tag in JS file to loading above website pages, like as below:
<iframe src="https://www.exapleA.com/test/"></iframe>
But I got the CSP errors like as below:
Refused to display 'https://www.exapleA.com/test' in a frame because an ancestor violates the following Content Security Policy directive: "frame-ancestors 'self'
You know the Android Cordova apps added all the static files into the wrapper, so there no domain can append in "frame-ancstors". So how to resolve this issue?
In your Cordova config (config.xml) you only have to add this:
Where custom-domain.co is like the domain of your Android APK.
Then, you will be able to config your website like so:
For more information see this link (section Configuration -> Hostname): https://github.com/ionic-team/cordova-plugin-ionic-webview