Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

xufei123
Valued Contributor

Does Sense widget not work for http link?

Hi,

I have enabled both http and https in QMC:

Both are working. I can access hub from http:

And from https:

However when I add both links into Sense Widget, http does not work and https works:

Does anyone know why this has happened? In real life, I need to embed a http link from another server. I can open it in web browser in this Sense server but when I embed it into widget, it does not work.

Thanks

Fei

6 Replies
xufei123
Valued Contributor

Re: Does Sense widget not work for http link?

Version is Sense server Feb 2018, 12.5.2.

m_schindler
Contributor II

Re: Does Sense widget not work for http link?

Hello Fei,

is the server you are trying to display the iframe on using https?

Because it is not allowed to embed a http-iframe on a https-site. If you are using Chrome or Firefox you can press F12 and look for error messages in the console.

Cheers,

Mathias

xufei123
Valued Contributor

Re: Does Sense widget not work for http link?

Thank you very much Mathias, that is very helpful!

I made Sense to allow http then I embedded a http link to http Sense widget. It works but I have another strange problem here.

I set up a setting variable, which pass the link to the widget:

It is working for the links in the server so http://win2016fei01/qmc, or http://win2016fei01/hub or http://win2016fei01/dev-hub

However if I try any link that is not in the server for example the news website http://www.nzherald.co.nz/ it does not work. Nothing is showing and no error message is given.

If I embed the external link directly into the html code, it works:

Why did that happen? Anyway to solve it? I just want to use this widget to pass the links including external links to the widget html code.

Thanks

Fei

m_schindler
Contributor II

Re: Does Sense widget not work for http link?

Hello Fei,

this seems to be an issue with angular's "$sce service". I get the following error message in dev-hub:

Error: [$interpolate:interr] Can't interpolate: {{ settings.property1 }}

Error: [$sce:insecurl] Blocked loading resource from url not allowed by $sceDelegate policy


Usually you would circumvent this by using the "$sce.trustAsResourceUrl()"-method.

This got rid of the error message but unfortunately still did not display the web page so I don't know how solve this :/.

Cheers

xufei123
Valued Contributor

Re: Does Sense widget not work for http link?

Thank you so much Mathias.

I have searched and found the official explanation:

https://docs.angularjs.org/error/$sce/insecurl

It looks that I have to live with it. Doesn't make much sense that it doesn't even work for the servers in the same domain...

How did you use the "$sce.trustAsResourceUrl()"-method, can you code that in the html in the widget???

Thanks

Fei

m_schindler
Contributor II

Re: Does Sense widget not work for http link?

You're welcome.

I used it like: <iframe src="{{ $sce.trustAsResourceUrl(settings.property1) }}"></iframe>


Have you tried creating an extension instead of a widget, maybe its working there :/.


Mathias

Community Browser