I want to add the "tweet this" button to the site. Simple enough, right? The trick is that the site is designed to work on an embedded platform that does not particularly handle pop-ups, so I try to do everything inside the page.
I can successfully create my tweet button, connect the onClick handler to it and create the correct twitter.com/share URL for the relevant content. Everything works fine when I open this URL in a new window using window.open. However, if I try to open the URL in an iframe, nothing is loaded in the frame. Even loading http://twitter.com in an iframe fails. However, loading Google or any other website seems to work very well.
Any thoughts on what I'm missing here? Thank you --zach
Edit:
Yes, they detect an iframe on loading and extinguish the page:
if (window.top !== window.self) {
document.write = "";
window.top.location = window.self.location;
setTimeout(function(){ document.body.innerHTML='';},1);
window.self.onload=function(evt){document.body.innerHTML='';};
}
Any reasonable way to get around this, or am I stuck writing my own auth pipeline through oauth? I don't need any of their APIs, just letting users tweet to their own accounts.