简体   繁体   中英

Why does Firefox not like the Facebook Log In popup window?

The Question: Why does Firefox not like the Facebook Log In popup window?

The Setup: I am implementing the Facebook " Login for JavaScript " functionality on a web site. I have copied the sample code directly and set it up on a local web server for testing. The only thing I have changed from the sample code is that I added the appId for my application.

The Story: When I access the code in a browser, I am presented with a Facebook Log In button, as expected. In Chrome and Safari, when I click on the Log In button, I get a popup window that allows me to type in my Facebook credentials. However, in Firefox (v26.0) the popup tries to open but then disappears. I would say it is blocked by Firefox, but usually Firefox tells me about something that it blocks. In this case, the popup unceremoniously just goes away. ( Video screen capture of the disappearing popup. )

What I Have Tried: I tried this in other browsers without issue. I made sure that the sample code was unchanged other than the appId . I watched the console for messages and saw nothing out of the ordinary. The popup window is using the following URL:

// wrapped for reading convenience 
https://www.facebook.com/dialog/oauth?
    scope=
    &response_type=none
    &redirect_uri=https%3A%2F%2Fwww.facebook.com%2Fdialog%2Freturn
        %2Farbiter%3Frelation%3Dopener%26close%3Dtrue%23origin
        %3Dhttp%253A%252F%252Ftestsite.dev%253A8090%252Ff327c2a561b678
    &seen_v4_nux=false
    &state=f3da5377afecdda
    &app_id=012345678901234 // obviously obfuscated
    &display=popup

If I paste that URL into the Chrome or Safari address bar I get a login dialog. If I paste that URL into the Firefox address bar I get a seemingly blank window. Viewing the source reveals the following:

<script>
    (function _(a,b,c,d,e){
        document.domain='facebook.com';
        var f=window[a];
        if(f)
        if(window.location.protocol==b
        {if(!f.closed)f.require('Arbiter').inform('platform/dialog/response',d);}
        else if(f.postMessage)
        {if(!b.match(/^https?:$/)||!c.match(/\.facebook\.com$/))
        throw new Error('Invalid Origin: '+b+'//'+c);
        f.postMessage('FB_DIALOG_RESPONSE:'+JSON.stringify(d),b+'//'+c);
        }e&&window.close();})
        ("opener", "https:", "www.facebook.com", {
        "error_code":901,"error_message":"This app is in sandbox mode.
        Edit the app configuration at http:\/\/developers.facebook.com\/apps
        to make the app publicly visible.","state":"f97b48e573c33"}, true
    );
</script>

If I disconnect from the Internet and click the Log In button, the popup window stays, but is completely blank, other than the URL it is trying to load (see above).

Other Info: I am using Mac OS X.

它也发生在我身上 - 删除Facebook的饼干解决了它:)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM