Skip to content
This repository has been archived by the owner on Jan 13, 2022. It is now read-only.

Commit

Permalink
Merged upstream changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mackers committed Jun 10, 2010
2 parents 3068a31 + cf695ba commit dc0a6fc
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions chrome/content/lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,11 +294,19 @@ function MoveInList(dir) {
function FacebookLogin() {
if (fbSvc.loggedIn) {
dump('logging out\n');
fbSvc.sessionEnd();

// Some methods require us to get the wrapped object (namely getCommonParams())
var facebookSvc = Cc['@facebook.com/facebook-service;1'].
getService(Ci.fbIFacebookService).
wrappedJSObject;

var req = new XMLHttpRequest();
req.open('post', 'http://www.facebook.com/logout.php');
req.open('post', 'http://www.facebook.com/toolbar_logout.php');
req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
req.send('confirm=1');
req.send('api_key=' + facebookSvc.apiKey +
'&uid=' + facebookSvc.loggedInUser.id +
'&session_key=' + facebookSvc.getCommonParams().session_key);
fbSvc.sessionEnd();
} else {
// popup login page height is at most 500, but add 20 pixels for the
// button we show at the bottom of the page
Expand Down

0 comments on commit dc0a6fc

Please sign in to comment.