What to use instead of iframe

42 views
Skip to first unread message

Edmar Junior

unread,
Nov 26, 2015, 8:59:45 AM11/26/15
to phonegap
Hi guys,

I want to append a external web page inside a div, keeping my header and footer.

But this page is https (https://bitbucket.org/ for example), and as I use iframe to do it, I get an error:
"Refused to display 'https://bitbucket.org/' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'."

Do you guys know another way to place an external web page inside a div?

Jesse Monroy

unread,
Nov 28, 2015, 12:40:02 AM11/28/15
to phonegap
@Edmar,
to load an external webpage, your best option is to use the InAppBrowser. However, once you do this you are breaking the new whitelist security system. As such, you CANNOT use any of the Cordova APIs. You CAN use *some* HTML5 APIs, but that is highly system dependent.

On your warning, you need to implement the whitelist system. Specifically, you need to implement CSP on your webpage, and the remaining portions in your config.xml

This whitelist worksheet should help.
HOW TO apply the Cordova/Phonegap the whitelist system.

You likely have some questions. This FAQ will help on some. Read the bold sentences.
Top Mistakes by Developers new to Cordova/Phonegap

Best of Luck
Jesse
Reply all
Reply to author
Forward
0 new messages