Software Archive
Read-only legacy content
17061 토론

I can´t show external page because whitlelist

Juan_R_
초급자
1,272 조회수

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 포인트
1 솔루션
Swati_S_Intel1
1,272 조회수

@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 포인트
6 응답
Pamela_H_Intel
중재자
1,272 조회수

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 포인트
Juan_R_
초급자
1,272 조회수

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 포인트
Anusha_M_Intel1
1,272 조회수

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

0 포인트
Swati_S_Intel1
1,273 조회수

@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 포인트
Juan_R_
초급자
1,272 조회수

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 포인트
Elroy_A_Intel
직원
1,272 조회수

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

0 포인트
응답