I am looking forward to create a javascript API that contains most of the functions that facebook Javascript API provides.
FB.api FB.init FB.logout FB.getLog
Take a look at https://github.com/facebook/facebook-js-sdk/blob/deprecated/src/core/xd.js
They use a combination of rpc workarounds (with a relay file), Flash Local Connection and postMessage, whichever is supported by the browser.