在Chrome扩展程序上注销Facebook

编程入门 行业动态 更新时间:2024-10-28 20:17:19
本文介绍了在Chrome扩展程序上注销Facebook的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个使用facebook Graph API的chrome扩展程序

I have a chrome extension that uses the facebook Graph API

因为它是Chrome扩展程序,所以我正在使用Native App流进行登录.我使用内容脚本从重定向URL中获取令牌.

Because its a Chrome extension I was using the Native App flow to login. I used content-scripts to grab the token out of the redirect URL.

但是,我找不到注销Facebook的方法.我尝试了发布在此处的注销方法: Facebook Oauth注销,但似乎没有工作(我使用我的应用程序ID作为API密钥,并将重定向返回的代码"参数用作会话密钥)

However, I'm unable to find a way to logout of facebook. I tried the logout method posted here: Facebook Oauth Logout , but it doesn't seem to work ( I used my App Id as the API key and the "code" parameter returned by the redirect as the session key )

有人知道这样做的方法吗?

Does anyone know of a way to do this?

推荐答案

因此,在跟踪SDK注销过程后,我发现它只是删除了Facebook用户Cookie.具体来说,这段代码将以chrome扩展名退出用户(需要cookie许可):

So, after tracing the SDK logout procedure I found it just deletes the users Cookies for Facebook. Specifically this chunk of code will log the user out in a chrome extension (requires cookie permission):

var facebookDomain = "www.facebook"; chrome.cookies.remove ( {"url": facebookDomain, "name": "act" } ); chrome.cookies.remove ( {"url": facebookDomain, "name": "c_user" } ); chrome.cookies.remove ( {"url": facebookDomain, "name": "checkpoint" } ); chrome.cookies.remove ( {"url": facebookDomain, "name": "lu" } ); chrome.cookies.remove ( {"url": facebookDomain, "name": "s" } ); chrome.cookies.remove ( {"url": facebookDomain, "name": "sct" } ); chrome.cookies.remove ( {"url": facebookDomain, "name": "xs" } );

更多推荐

在Chrome扩展程序上注销Facebook

本文发布于:2023-08-06 13:09:33,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1312598.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:程序   Chrome   Facebook

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!