Hello!
I want to write an extention with chrome that authenticates the user
with the Facebook API and gets a session key back. Now this is not
possible AFAIK with the current Facebook JS library, as it requires a
CDCC ( http://wiki.developers.facebook.com/index.php/Cross_Domain_Communication
) - which is something a server uses as opposed to a client side
plugin.

Luckily Facebook are creating a new Javascript library that does not
need a CDC Channel - 
http://wiki.developers.facebook.com/index.php/JavaScript_SDK_(Open_Source).
This looks perfect to my needs, and the examples look simple. However
it doesn't quite work as advertised.
I tried this code:

<!DOCTYPE html>
<html><body><div id="fb-root"></div>
<div id="response">No response so far</div>
<script src="http://static.ak.fbcdn.net/connect/en_US/core.js";></
script>
<script>
  FB.init({ apiKey: 'a3b4b51b7fb8b59401d1b0f2505cd601',
                cookie: true});
  FB.login(function(response) {
  if (response.session) {
    document.getElementById("response").innerHTML = 'we got a
response'
  } else {
    // user cancelled login
    document.getElementById("response").innerHTML = 'failed'
  }
});
</script></body></html>

Which should in theory open a little popup window to facebook.com/
login.php. However in practice it does not - Chrome opens a window (of
the right size) with an error:
"The webpage at chrome-extension://www.facebook.com/login.php?
api_key=a3b4b51b7fb8b5940etcetc might be temporarily down or it may
have moved permanently to a new web address". Basically a 404 error.
The URL is right, but its looking for an internal page. As far as I
can tell I have allowed www.facebook.com/* and api.facebook.com/* in
the permissions field of the manifest file.

Many thanks, Tom.

--

You received this message because you are subscribed to the Google Groups 
"Chromium-extensions" group.
To post to this group, send email to chromium-extensi...@googlegroups.com.
To unsubscribe from this group, send email to 
chromium-extensions+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/chromium-extensions?hl=en.


Reply via email to