Rectangle 27 0

I think I got it. I will post it here in the case someone else falls in the same misconception I did.

Looking at the response headers in my regular desktop browser I noticed that the pages which won't load in the mobile app iframe have the X-Frame-Options: SAMEORIGIN set in their response headers. This option tells the web-browser NOT to load that page in a frame unless the window belongs to the same origin. Since my iframe doesn't qualify, the page won't load. https://developer.mozilla.org/en-US/docs/HTTP/X-Frame-Options

I had also (mis)understood the goal of the config.xml whilelisting: That whitelisting is places the app can visit. It has little to do with what can be received by the app. My bad.

Its not a plugin and comes along with PhoneGap. So there is guaranteed manitenance and upgrades for every version of PhoneGap.

Great tip, WhizKid747! I've been working with inAppBrowser for the last 2 days now. Exactly what I needed. Thanks again.

Can't properly load external URLs in an iframe with cordova iOS - Stac...

cordova iframe ssl external
Rectangle 27 0

A possible solution is Web messaging or cross-document messaging. Here's a blog post where someone used this method to gain access to a mobile device's camera from an external page loaded in an iframe. Although this person had the opposite goal (get data from Cordova to page loaded in iframe), they were able to accomplish cross domain communication between a page in an iframe and Cordova; which is what I believe you are trying to do.

javascript - How to get data from an external site inside a cordova ap...

javascript angularjs cordova iframe cors
Rectangle 27 0

You should use the InAppBrowser plugin to open up an external web page. This is going to be much safer since the foreign page won't have access to your Cordova instance. (If I have a third party page, and you load my page into your app through an iFrame, I can easily "hack" your application and steal user data, run arbitrary Cordova commands, etc.)

Additionally, when using the InAppBrowser, you can tell the browser to open any links in the current Cordova WebView, so that external site will just appear in your app. I don't know what your external site looks like, but this might be what you want to do. You can accomplish this by setting the target as _self, like this:

var ref = window.open('http://apache.org', '_blank', 'location=yes');

javascript - make an iframe loaded in app display mobile site? - Stack...

javascript jquery html css cordova
Rectangle 27 0

A possible solution is Web messaging or cross-document messaging. Here's a blog post where someone used this method to gain access to a mobile device's camera from an external page loaded in an iframe. Although this person had the opposite goal (get data from Cordova to page loaded in iframe), they were able to accomplish cross domain communication between a page in an iframe and Cordova; which is what I believe you are trying to do.

javascript - How to get data from an external site inside a cordova ap...

javascript angularjs cordova iframe cors