Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Facebook popup up is blocked in Chrome (v31) #24

Closed
evdoks opened this issue Nov 27, 2013 · 15 comments · Fixed by #48
Closed

Facebook popup up is blocked in Chrome (v31) #24

evdoks opened this issue Nov 27, 2013 · 15 comments · Fixed by #48
Assignees

Comments

@evdoks
Copy link

evdoks commented Nov 27, 2013

It seems that Chrome blocks the Facebook pop-up, when using your module (try the demo). In Firefox it is working fine.

@luiscarlosjayk
Copy link
Owner

Hi @Silentser ,

could you provide an example on your own implementation at Plunkr?
So I could check, since it is working for me.

Thanks

@evdoks
Copy link
Author

evdoks commented Dec 2, 2013

I was using your demo implementation on Plunker. I am trying it on OS X with Chrome 31. Maybe it has something to do with your pop-up blocking settings? I also attach the screenshot: screen shot 2013-12-02 at 10 44 52

@luiscarlosjayk
Copy link
Owner

Hi @Silentser,

have you tried on a project from yourself? localhost or perphaps a live url? I'm using it on projects and it's working normally.

So, please try it and provide a link in case the issue persists.
Please, after trying it, answer if it was successful or not, so this can be known.

(see a localhost simple demo)
image

Regards

@taraxe
Copy link

taraxe commented Dec 4, 2013

The sample demo you provide http://plnkr.co/edit/dDAmvdCibv46ULfgKCd3?p=preview is blocked for me using both chrome 30.0.1599.66, 31.0.1650.57 and even Firefox 24, 25 and 25.1 using Mac OS X.

Hope this helps.

@evdoks
Copy link
Author

evdoks commented Dec 4, 2013

I believe the problem with the demo is having Facebook.login() in the callback of asynchronous Facebook.getLoginStatus function. In order for FB popup not to be blocked a browser popup blocker, the call to Facebook.login() should be a result of a user action (click on a button). By calling this function in a callback puts it in a new context and therefore the pop up is blocked.

@taraxe
Copy link

taraxe commented Dec 6, 2013

Ok,
I think it's a problem because you'll only want to call login after checking loginStatus.

@luiscarlosjayk
Copy link
Owner

I think you are right, just haven't had the time to propose a solution.
If you come with any before me, please provide it.
Thanks for your collaboration @taraxe, @Silentser

@kasparasg
Copy link

I ran into this issue too and the way I went about it was like this:

// In your app config
$routeProvider
      .when('/signin', {
        templateUrl: '/partials/users/signin.html',
        controller: 'SigninCtrl',
        resolve: {
          FBStatus: function($q, Facebook) {
            var defer = $q.defer();

            Facebook.getLoginStatus(function(result) {
              defer.resolve(result);
            });

            return defer.promise;
          }
        }
      })

// Then in controller
.controller('SigninCtrl', function(FBStatus, Facebook) {
  if (FBStatus.status !== 'connected') {
    Facebook.login(function(response) {
      // Do something with response
    });
  }
});

Hope it helps.

@austinpray
Copy link
Contributor

The callback will not fire for me in safari due to:

[Error] Blocked a frame with origin "http://static.ak.facebook.com" from accessing a frame with origin "http://localhost:3000". The frame requesting access set "document.domain" to "facebook.com", but the frame being accessed did not. Both must set "document.domain" to the same value to allow access.
    (anonymous function) (xd_arbiter.php, line 18)
    ca (xd_arbiter.php, line 18)
    p (xd_arbiter.php, line 18)
    q (xd_arbiter.php, line 18)
    (anonymous function) (xd_arbiter.php, line 18)
    (anonymous function) (xd_arbiter.php, line 18)
    require (xd_arbiter.php, line 18)
    global code (xd_arbiter.php, line 34)

in the console. I am researching a fix now.

@austinpray
Copy link
Contributor

The callback is not firing because safari on iOS 7 and the latest desktop safari is blocking the facebook login as a popup.

@altsanz
Copy link

altsanz commented Mar 30, 2014

Still blocked on Google Chrome Versión 34.0.1847.92 beta and Firefox 27.0.1 on Mac OS X

@mrzmyr mrzmyr changed the title Facebook poop up is blocked in Chrome (v31) Facebook popup up is blocked in Chrome (v31) Mar 31, 2014
@luketn
Copy link

luketn commented Apr 15, 2014

Still blocked for me on Chrome as well.

@evdoks
Copy link
Author

evdoks commented Jul 11, 2014

@foreachlt - thanks a lot - your workaround works perfectly!

@obibring obibring assigned obibring and unassigned luiscarlosjayk Aug 2, 2014
mrzmyr pushed a commit that referenced this issue Aug 17, 2014
refactor(login): Refactor login() method to invoke FB.login() synchronously

closes #24
@austinpray
Copy link
Contributor

Sweet!

@mrzmyr
Copy link
Collaborator

mrzmyr commented Aug 17, 2014

Thanks for your contribution guys ! 👍 If you have any problems according this issue please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
9 participants