Software Archive
Read-only legacy content
17061 Discussions

I can´t show external page because whitlelist

Juan_R_
Beginner
1,237 Views

Hi!

I´m using cordova cli version 5.1.1 and I have a little big problem.

In my app I´m using, as always, an iframe tag, in order to show another webs, but when I build the app, the <iframe> doesnt show anything at all. In emulate mode, I can see it propoerly.

I follow the instrucctions about whitelist 5.1.1, that I got it here, but or I don´t understand  the CSP Controls, or the whitelist rules, neither anything at all. what can I do?codigo.jpg

Iframe code

 

whitelist_0.jpgWhite list fields.

 

 

Please I need an answer ASAP.

0 Kudos
1 Solution
Swati_S_Intel1
Employee
1,237 Views

@Juan, Most likely the website you are trying to access in iFrame has X-Frame-Options set which will prevent the website to be iFramed. If you own that website you can change the X-Frame-Options header but if you don't own it you are out of luck. I recommend you use inAppBrowser to load a third-party website. We have a sample app on how to invoke inAppBrowser. 

View solution in original post

0 Kudos
6 Replies
Pamela_H_Intel
Moderator
1,237 Views

Juan,

First check if whitelisting is the problem. Use the old XDK method (W3C Widget Access) as shown in the attached image (it's simpler, and you don't need the functionality of the new method if you only want to access a website). Just put an asterisk in the Network Requests box. You can also put an asterisk in the Intent box, but you shouldn't need to. An asterisk in both boxes will match the emulator settings. If your app still has the same issue, then whitelisting is not the problem. For reference, read this article: https://software.intel.com/en-us/xdk/articles/cordova-cli-412-domain-whitelisting-with-intel-xdk-for-ajax-and-launching-external-apps

 

0 Kudos
Juan_R_
Beginner
1,237 Views

First things, first. Thanks Pamela for your answer.

(I´ve read the article and another about whitelist 5.1.1. but as you said, maybe that´s not the problem.)

I´m tried with a new <iframe> from a simple template with your advices, but it is not working neither :(. You can see it in my attach.

So far all my projects have worked fine, but something changed in the last update, and I don´t know what.

I have open an app framework, dragged and dropped an iframe widget, follow your instruccion on whitelist fields, worked in emulate tab, but in the final build didn´t work the iframe widget, as you can see in my attach images files.

Do you have any idea it could help me?

 

Thanks!

 

Juan Rived

0 Kudos
Anusha_M_Intel1
Employee
1,237 Views

Let me try this on device and let you know soon. 

0 Kudos
Swati_S_Intel1
Employee
1,238 Views

@Juan, Most likely the website you are trying to access in iFrame has X-Frame-Options set which will prevent the website to be iFramed. If you own that website you can change the X-Frame-Options header but if you don't own it you are out of luck. I recommend you use inAppBrowser to load a third-party website. We have a sample app on how to invoke inAppBrowser. 

0 Kudos
Juan_R_
Beginner
1,237 Views

Thanks, I´ve tried with a personal web site and it works, but with differents external websites (not mine) does´t works.

If I used inAppBrowser to load a 3th-party website, Will I get it?  I appreciated

0 Kudos
Elroy_A_Intel
Employee
1,237 Views

I recommend in-App Browser versus iframes as some sites tend to block rending in the latter.

0 Kudos
Reply