title: facebook authentication using javascript via Chrome extension
body: <p>I am trying to display a simple alert window using my chrome extension when a user is logged on to facebook. I have the javascript sdk initializing code  and also the code to get login status in my background.html page. My manifest.json file calls the background page correctly.</p>
  
  <p>I am unable to place a breakpoint on the background.html page. I want to know if this is how i should go about declaring javascript facebook sdk and checking if a user is logged in.</p>
  
  <pre><code>&lt;div id="fb-root"&gt;&lt;/div&gt;
  
  &lt;script src="http://connect.facebook.net/en_US/all.js"&gt;&lt;/script&gt;
  
  &lt;script&gt;
  
  window.fbAsyncInit = function() {
      FB.init({
        appId  : 'my App id (i have my app id)',
        status : true, // check login status
        cookie : true, // enable cookies to allow the server to access the session
        xfbml  : true  // parse XFBML
      });
    };
  
    (function() {
      var e = document.createElement('script');
      e.async = true;
      document.getElementById('fb-root').appendChild(e);
    }());
  
   FB.getLoginStatus(function(response) {
      if (response.authResponse) {
            alert("logged in");} 
      else {
          // no user session available, someone you dont know                                                                                                            
      }
  });
  
   &lt;/script&gt;
  </code></pre>