title: Chrome blocks FB.login()
body: <p>I have a FB app which need to be integrated in a FB page tab. In app I want to provide a "Signup with FB login" option. This button when clicked should prompt the user to login into FB login dialog. On successful login it should prompt the user to authenticate and allow the app to use his details. Once the user allows the app to access the user details it should then post the details to my website in a new window. </p>
  
  <p>This process works fine when I test the app independently. However when I add the app to the fb page, chrome blocks the Fb login dialog. Before opening the Fb login dialog I check if the user is already logged in FB and has accepted the app. For that I use FB.getLoginStatus(checkLoginStatus); I figured due to this check the context moves to script execution and hence Chrome blocks the login dialog.</p>
  
  <p>Is there a work around for this issue? Help would be highly appreciated.</p>
  
  <p>My code is as follows:</p>
  
  <p>The facebook button is created  using span and the id fbc-login-button is given to an a tag.</p>
  
  <pre><code>$("#fbc-login-button").click(function(){
     FB.getLoginStatus(function(response) {
                  if (response.status === 'connected') {
                      console.log('Logged in.');
                      if (response.authResponse) {
                          fbAppSignup(response);
                      }
                  }
                  else {
                      FB.login(function(response) {
                          if (response.authResponse) {
                              fbAppSignup(response);
                          }
                      },{scope: "email, user_friends",display:"popup"});
                  }
              });
  
      function fbAppSignup(response,myPopup){
          var uid = response.authResponse.userID;
          var accessToken = response.authResponse.accessToken;
          FB.api("/me", function(response) { 
              $("#social_media_data").val(JSON.stringify(response));
              $("#medium").val("facebook");
              $("#accessToken").val(accessToken);
              $("#socialClickSource").val("fbapp_facebook_signup");
              $("#fbSignUp").submit();
              return true;
          });
      }
  </code></pre>