通过JavaScript打开Facebook的连接窗口?
当某人尝试通过Facebook登录到我的网站时,他被重定向到一个页面,在该页面上他可以看到所有请求的权限,然后单击以允许/禁止它们.
When someone tries to login to my site via facebook, he's redirected to a page where he sees all the requested permissions and click to allow / disallow them.
有什么办法可以通过javascript在不让用户离开我的网站的情况下将页面作为分层窗口打开?例如,当Facebook连接窗口悬停在其上方时,我的网站将处于后台.
Is there any way to have this page open up as a layered window through javascript without having the user leave my website? E.g so my website would be in the background while the facebook connect window hovers above it.
有什么想法吗?
答案是否定的.另外,由于Facebook为该页面提供了分帧器,因此您无法在IFrame中加载登录页面.
The answer is no. Also, you can't load the login page within an IFrame since Facebook has a frame breaker for that page.
您正在谈论的页面称为 OAuth对话框.默认情况下,由于"display"参数设置为"page"(其他值包括:popup,iframe,touch和wap),请求用户登录到您的应用将导致页面重定向.您想要的是在显示设置为"iframe"的情况下调用此对话框.但是,文档状态:如果指定iframe,则必须具有有效的access_token."并且,要获得access_token,用户需要首先登录到您的应用程序.因此,您将无法在嵌入式IFrame中显示登录页面.
The page you're talking about is called the OAuth dialog. By default, requesting users to login to your app will cause a page redirect since the "display" parameter is set to "page" (other values include: popup, iframe, touch, and wap). What you want is to invoke this dialog with display set to "iframe". However, the documentation states: "If you specify iframe, you must have a valid access_token." And, to get an access_token, the user needs to first login to your app. For that reason, you won't be able show the login page within an embedded IFrame.
但是,一旦用户使用基本权限集授权了您的应用,您就可以通过对话框的显示模式将其提示为"iframe"来提示该用户其他权限(因为您具有access_token).
However, once a user authorizes your app with a basic permission set, you may prompt that user for additional permissions with the dialog's display mode to "iframe" (since you have the access_token).