How to open the Twitter site within an Iframe

Asked

Viewed 1,020 times

0

I’m trying to open the Twitter site inside a iframe

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

or showing a particular purpose

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

I would like to place next to a web page the iframe, but he shows nothing. Does Twitter have a block for its use on web pages? If it’s possible someone could show me how it’s done?

2 answers

4

Twitter blocks this by a configuration of their own server, sent a flag by the HTTP Reply:

X-Frame-Options = "SAMEORIGIN"

Thus, uploading pages from their website to an iframe will only be possible within the same domain (twitter.com). Your browser will deny opening the content by identifying this value in the HTTP Response. As you can understand, this is a configuration of security guard, to avoid hijackings.

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

0

Twitter blocks this by a configuration of their own server, sent a flag by the HTTP Reply:

But Twitter provides a search API see if it helps you with something "https://twitter.com/search?q=%40a_sua_busca" It does not work in Iframe

Browser other questions tagged

You are not signed in. Login or sign up in order to post.