iframes in phonegap not working in latest version

4,373 views
Skip to first unread message

Frank B

unread,
Feb 8, 2016, 11:11:00 AM2/8/16
to phonegap
I've just installed Phonegap and tried to show an iframe in a html page and it just shows an empty iframe. When we changed the Phonegap version back to version 3.7.0. it worked fine.
Does anyone know why this is happening. Don't the latest versions support iframes?

Kerri Shotts

unread,
Feb 8, 2016, 3:55:44 PM2/8/16
to phonegap
Not really enough information here to help much. Review the welcome text for this group and repost the appropriate information.

At first guess, I'm thinking whitelist / CSP issues, but it's hard to know that without additional information.

Frank B

unread,
Feb 9, 2016, 3:07:41 AM2/9/16
to phonegap
I'm using  PhoneGap (iOS / Android / Windows) cli-5.4.1 (3.9.2 / 4.1.1 / 3.8.2). My OS is Windows 8.1. The devices i've tested it on are the Samsung galaxy s3 Neo and the Samsung galaxy s6.

My config.xml includes:
  <access origin="*"/>
  <plugin name="cordova-plugin-whitelist" version="1"/>

This is my html code
<h1>Test123</h1>
<div style="background-color:red; width:20px; height:20px;">dfdfgdf</div>
<iframe src="http://www.trainstation.nl" style="width:100%; height:100%;"></iframe>

Op maandag 8 februari 2016 17:11:00 UTC+1 schreef Frank B:
Screenshot_2016-02-09-08-57-24.png

Jesse Monroy

unread,
Feb 10, 2016, 7:32:39 PM2/10/16
to phonegap
You are not applying the whitelist correctly.

HOW TO apply the Cordova/Phonegap the whitelist system

Jesse

Frank B

unread,
Feb 11, 2016, 4:05:45 AM2/11/16
to phonegap
Thank you for this document. I followed the steps but the whitelist still doesn't work. I was not clear where to put the gap plugin. So i put it in the config.xml.

I've also added this to the config.xml:
<allow-navigation href="*" />
<allow-intent href="*" />
<access origin="*" />

I have added this to the index.html:
    <meta http-equiv="Content-Security-Policy" 
             content="default-src *; 
                      style-src * 'self' 'unsafe-inline' 'unsafe-eval'; 
                      script-src * 'self' 'unsafe-inline' 'unsafe-eval';">

Op donderdag 11 februari 2016 01:32:39 UTC+1 schreef Jesse Monroy:

Kerri Shotts

unread,
Feb 11, 2016, 12:42:26 PM2/11/16
to phonegap
The plugin line in your config.xml looks to me like you're using PG build due to the version attribute. The CLI uses spec for version numbers. Furthermore, why just v1 of the plugin? There's several releases since then, with 1.2.1 being the current version.

Also, check your Android console output (adb logcat) and the Javascript console for any error messages that might be useful.

On Thursday, February 11, 2016 at 3:05:45 AM UTC-6, Frank B wrote:
...

Frank B

unread,
Feb 12, 2016, 2:55:45 AM2/12/16
to phonegap
Yes i'm using phonegap build. I just downloaded it this week and the plugin line was already in the config.xml with version 1.
How do i check android console output using phonegap build?

Op donderdag 11 februari 2016 18:42:26 UTC+1 schreef Kerri Shotts:

Frank B

unread,
Feb 12, 2016, 7:47:27 AM2/12/16
to phonegap
I've found the problem.When i downloaded phonegap the config file was in the wrong directory. Now i put it in the right directory and it works.
Thanks for the replies.

Op maandag 8 februari 2016 17:11:00 UTC+1 schreef Frank B:
I've just installed Phonegap and tried to show an iframe in a html page and it just shows an empty iframe. When we changed the Phonegap version back to version 3.7.0. it worked fine.

Jesse Monroy

unread,
Feb 12, 2016, 10:14:17 PM2/12/16
to phonegap
@Kerri,
when using the a plugin version, it is most prudent to always use the last version closest to the release you are using.

For example

PGB cli-5.2.0 was release on 2015/09/23.
However the Cordova CLI 5.2.0 was released on 2015/08/13
For plugin to have the most success in working, a developer should use the plugins released on 2015/06/22

The reason being is that plugins release to far after Cordova CLI 5.2.0 was released will require the next release of Cordova CLI.

Needless to say this causes some confusion, but that how it works. This is, of course, why I wrote the recent,

How Cordova and Phonegap releases work

See the lower section on

Phonegap Build Plugins Caveats

for rules on how get the correct plugin for PGB.

Respectfully
Jesse

Himanshu Panchal

unread,
Mar 3, 2016, 11:38:41 AM3/3/16
to phonegap
Same issue for me alos

When click any link into iframe it goes to external browser in ios

Any idea?
Reply all
Reply to author
Forward
0 new messages