user5758875
user5758875

Reputation: 39

external site does not load in iFrame for cordova

In the android app I built using phonegap/cordova CLI, I have an Iframe load external site. This works fine till now and suddenly stopped since last week. In my config file I have

<plugin name="cordova-plugin-whitelist" version="1" />

I put the meta tag in the index.html:

<meta http-equiv="Content-Security-Policy" content="default-src *;
style-src * 'unsafe-inline'; script-src * 'unsafe-inline'; media-src *">

what changed in cordova-plugin-whitelist that is causing this issue?

Upvotes: 2

Views: 1426

Answers (1)

Salvatore Tempesta
Salvatore Tempesta

Reputation: 13

You should also add the frame definition in your meta tag, like this:

frame-src * 'self'

Please consider that using wildcard is not safe. Also you should add the following meta tag in your config.xml cordova file:

<access origin="*"/>
<allow-navigation href="*"/>

Upvotes: 1

Related Questions