Iframe - https site not working my app. Please help


#1

Iframe - https site not working my app. Please help


#2

Hello Try embedding a youtube video. I tried and it working.


#3

Kindly share code. This is iframe https url : https://www.genworth.com/life-and-annuity-transition-sales-center.html itn’t working


#4

Hello I tried the above URL and its not rendering the page within i-frame because, Same-Origin policy has been set for the site and you cannot embed that site within in an iframe. Even you cannot embed https://www.google.com within the iframe because of same-origin policy. For more information checkout this link:

http://javascript.info/tutorial/same-origin-security-policy

On my console I got this error this is because of same origin policy:
Refused to display ‘https://www.genworth.com/life-and-annuity-transition-sales-center.html’ in a frame because it set ‘X-Frame-Options’ to 'SAMEORIGIN


#5

Having used iframe personally but this might help https://cordova.apache.org/docs/en/latest/guide/appdev/whitelist/ ?


#6

You really should not be using iframes at all in you app.
If you need to load content from a website, use the inappbrowser plugin.


#7

Thanks for your suggestion, kindly share inappbrwser plugin url or sample code…


#8

Inappbrowser used to open a external browser in our app. but how to open with in a page?


#9

InAppBrowser is ugly though… it loses app’s UI (header, footer nav, etc) - typically not a great solution.


#10

Agreed, thats why I’ve been suggesting

As a better alternative


#12

hmm… interesting. screenshots don’t show app UI though; so how is this better than InAppBrowser?


#13

The point isn’t to show “app UI”, it for external content that you want to show, but not open in external safari.

If you want to actually load a site and embed it in your app, you’re not going to have a good time I’m afraid. Apps like this can be rejected by apple as they’re not what they want an app to be. Instead, setup a simple REST API and load JSON data.