Hi Folks,

I also tried the new javascript sdk and ran into the same problem. I
then tried using the older javascript library and was able to retrieve
the session object by redirecting to a trusted site and then parsing
out the session object from the url retrieved using the tabs api.

The problem I am facing is that I am not able to retrieve the user
data from facebook using the session object retrieved earlier. I set
the session object for use by FB.ApiClient.set_session in extensions
background.html but all my api calls to get the user data are going
into oblivion and the callbacks I provide are never called. The same
code works on a page served from the trusted site.

Any clues why this might be happening? Is the session only applicable
with domain of the trusted site (base domain)?

Thanks in advance for the help
Saurabh



On Dec 12 2009, 5:49 am, Nick Baum <nickb...@chromium.org> wrote:
> I'd love to hear if you get this to work. I've been wanting to write an
> extension that uses the Facebook API, but haven't had the time to do so yet.
>
> Cheers,
>
> -Nick
>
> On Fri, Dec 11, 2009 at 11:49 AM, Antony Sargent <asarg...@chromium.org>wrote:
>
>
>
> > See Nick's comment on this thread for a workaround:
> >http://groups.google.com/group/chromium-extensions/browse_thread/thre...
>
> > <http://groups.google.com/group/chromium-extensions/browse_thread/thre...>
>
> > On Tue, Dec 8, 2009 at 6:44 PM, Billiam <billiamthesec...@gmail.com>wrote:
>
> >> Unfortunately, it looks like the facebook core.js file determines which
> >> url to visit with the following:
>
> >> window.location.protocol+'//www.facebook.com/'
>
> >> So... Not really your fault, but I'm not seeing an easy and obvious
> >> solution, either.
>
> >> On Tue, Dec 8, 2009 at 3:11 PM, Tom <sharpbla...@gmail.com> wrote:
>
> >>> 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_So...)
> >>> .
> >>> 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 <http://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<http://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 allowedwww.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<chromium-extensions%2Bunsu
> >>>  bscr...@googlegroups.com>
> >>> .
> >>> For more options, visit this group at
> >>>http://groups.google.com/group/chromium-extensions?hl=en.
>
> >>  --
> >> You received this message because you are subscribed to the Google Groups
> >> "Chromium-extensions" group.
> >> To post to this group, send email to chromium-extensions@googlegroups.com
> >> .
> >> To unsubscribe from this group, send email to
> >> chromium-extensions+unsubscr...@googlegroups.com<chromium-extensions%2Bunsu
> >>  bscr...@googlegroups.com>
> >> .
> >> For more options, visit this group at
> >>http://groups.google.com/group/chromium-extensions?hl=en.
>
> >  --
> > 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<chromium-extensions%2Bunsu 
> > bscr...@googlegroups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/chromium-extensions?hl=en.
-- 
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