FB Iframe App: Use different stylesheets depending on whether the user views the app through my website or through Facebook

StackOverflow https://stackoverflow.com/questions/3951533

Question

I'm developing a facebook app which can be viewed in an iframe on Facebook itself, or as a standalone site (the line between Facebook Connect and iframe apps seems to have blurred...).

The stylesheet I have now looks good on my site, but doesn't look right when viewed through the FB iframe (probably b/c the browser screen is much bigger than the iframe). I'd like to use different stylesheets depending on whether the user is actually visiting my website, or accessing the app through Facebook.

How can I do this?

(I'm using Ruby on Rails, and Facebooker2)

Was it helpful?

Solution

When it is viewed as an app facebook sends a bunch of extra request parameters, you can check for those on server side.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top