Software Archive
Read-only legacy content
17061 ディスカッション

I can´t show external page because whitlelist

Juan_R_
ビギナー
1,268件の閲覧回数

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,268件の閲覧回数

@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. 

元の投稿で解決策を見る

6 返答(返信)
Pamela_H_Intel
モデレーター
1,268件の閲覧回数

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

 

Juan_R_
ビギナー
1,268件の閲覧回数

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

Anusha_M_Intel1
従業員
1,268件の閲覧回数

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

Swati_S_Intel1
従業員
1,269件の閲覧回数

@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. 

Juan_R_
ビギナー
1,268件の閲覧回数

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

Elroy_A_Intel
従業員
1,268件の閲覧回数

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

返信