0
content.js 표시되지Chrome.identity.getAuthToken이 크롬 확장을위한 콘텐츠 페이지 구글 사용자 목록을
document.getElementById("signIn").addEventListener("click", function(){
chrome.runtime.sendMessage({task:"switchUser", user: current_user},function(response){
});
});
background.js이 크롬 확장의 배경 페이지입니다
chrome.runtime.onMessage.addListener(
function(request, sender, sendResponse){
if(request.task == "switchUser"){
function getToken(){
chrome.identity.getAuthToken({ interactive: true }, function(token) {
sendResponse(token);
});
}
chrome.identity.removeCachedAuthToken({ token:
currentSessionAccessToken }, getToken);
}
return true;
});
이전 OAuth 토큰이 성공적으로 제거되었지만 getAuthToken을 사용하여 새 OAuth 토큰을 생성하면 사용자 선택 목록이 표시되지 않습니다. 그러나 대화 형을 true로 설정했습니다. 내가 뭘 놓치고 있니?