-
Notifications
You must be signed in to change notification settings - Fork 126
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
Comments
Hi @Silentser , could you provide an example on your own implementation at Plunkr? Thanks |
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. Regards |
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. |
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. |
Ok, |
I think you are right, just haven't had the time to propose a solution. |
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. |
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. |
The callback is not firing because safari on iOS 7 and the latest desktop safari is blocking the facebook login as a popup. |
Still blocked on Google Chrome Versión 34.0.1847.92 beta and Firefox 27.0.1 on Mac OS X |
Still blocked for me on Chrome as well. |
@foreachlt - thanks a lot - your workaround works perfectly! |
refactor(login): Refactor login() method to invoke FB.login() synchronously closes #24
Sweet! |
Thanks for your contribution guys ! 👍 If you have any problems according this issue please open a new one. |
It seems that Chrome blocks the Facebook pop-up, when using your module (try the demo). In Firefox it is working fine.
The text was updated successfully, but these errors were encountered: