I am using a facebook login feature in my website. But somehow when i throttle the speed using Chrome Developer tool, FB.init doesn't seems to work.
My event "fbReady" is not broadcasted. I put a debugger on line FB.getLoginStatus. But the script never stops because it's not initialising.
It works fine when there is no throttling of speed.
This is my initialization code.
var app = angular.module("myApp", ["ngRoute"]);
app.run(function($window, $rootScope, $location) {
$window.fbAsyncInit = function() {
FB.init({
appId: 'xxxxxx95',
status: true,
cookie: true,
xfbml: true,
version: 'v2.10'
});
FB.getLoginStatus(function(response){
if (response.status == "connected") {
$rootScope.userId = response["authResponse"]["userID"];
$rootScope.fbReady = true;
$rootScope.$broadcast('fbready');
$rootScope.$apply();
FB.api('/' + $rootScope.userId + '?fields=picture.type(square)', function(response) {
$rootScope.userPic = response["picture"]["data"]["url"];
})
}else{
$rootScope.fbReady = true;
$rootScope.$broadcast('fbready');
}
})
});