How to open the Twitter site inside an Iframe

1

I'm trying to open the Twitter site inside an iframe

<iframe src="https://twitter.com/"width="700" height="700" scrolling="no" ></iframe>

or showing a particular subject

<iframe src="https://twitter.com/search?q=Agricultura&src=tren"width="700" height="700" scrolling="no"></iframe>

I would like to place the iframe next to a web page, but it does not show anything. Does Twitter have any blocking for its use on web pages? If it is possible, could anyone show me how?

    
asked by anonymous 21.11.2014 / 19:57

2 answers

5

Twitter blocks this by setting their own server, sent a flag by HTTP Response:

X-Frame-Options = "SAMEORIGIN"

So loading pages from their site into an iframe will only be possible within the same domain (twitter.com). Your browser will deny opening content by identifying this value in HTTP Response. As you can see, this is a security setting, to avoid hijackings .

There is not much you can do. There may even be hacks, which take advantage of some security breach, by "GET", merging the value in the Header in server-side language, plugins in Chrome or Fiddle. But for this it is expected to be fixed in some update of the browsers or web servers, and at any time it may stop working.

    
21.11.2014 / 21:52
1
  

Twitter blocks this by setting their own server, sent a flag by HTTP Response:

However, Twitter provides an API that performs a search to see if it helps you in something " link " It does not work in Iframe

    
25.04.2017 / 03:16