0
votes

I am trying to use some URL in Iframe, But when i try to embed that Iframe in Ionic4 app, i got this error.

Refused to display 'https://twitter.com/afdonews' in a frame because it set 'X-Frame-Options' to 'sameorigin'.

My code for Iframe is

<iframe width="100%" height="100%" src="https://twitter.com/afdonews" scrolling="no" style="border: 0;" (load)="hideLoading()">
</iframe>

can you help me in this please?

1
that means Twitter doesn't allow a website to display twitter in an iframe unless it is them doing so - Mehdi

1 Answers

0
votes

Try this:

 <a class="twitter-timeline" href="https://twitter.com/afdonews?ref_src=twsrc%5Etfw">afdonews</a> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

Or use something like this:

<iframe border=0 frameborder=0 height=250 width=550 
 src="https://twitframe.com/show?url=https%3A%2F%2Ftwitter.com%2Fjack%2Fstatus%2F20"></iframe>

This is because twitter doesn't allow a website to display twitter in an iframe suggested by @Mehdi in comment.

I hope this helps! Thanks!