사용자가 페이스 북에 로그온 할 때 크롬 확장을 사용하여 간단한 경고 창을 표시하려고합니다. 자바 스크립트 sdk 초기화 코드 및 또한 내 background.html 페이지에서 로그인 상태를 얻을 코드가 있습니다. 내 manifest.json 파일이 배경 페이지를 올바르게 호출합니다.크롬 확장 프로그램을 통해 javascript를 사용하여 페이스 북 인증
background.html 페이지에 중단 점을 배치 할 수 없습니다. 이 내가 자바 스크립트 페이스 북 SDK를 선언하고 사용자가 로그인 한 경우 확인에 대해 이동하는 방법 경우 내가 알고 싶은
<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js"></script>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : 'my App id (i have my app id)',
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true // parse XFBML
});
};
(function() {
var e = document.createElement('script');
e.async = true;
document.getElementById('fb-root').appendChild(e);
}());
FB.getLoginStatus(function(response) {
if (response.authResponse) {
alert("logged in");}
else {
// no user session available, someone you dont know
}
});
</script>
는이 작업을 수행하는 가장 좋은 방법을 찾았나요? :) – TigrouMeow