chrome.identity.getProfileUserInfo() returns empty id [duplicate]

杀马特。学长 韩版系。学妹 提交于 2019-12-11 07:32:35

问题


I don't know if this is a development only issue, because I've not published my extension. getProfileUserInfo() returns {email:"",id:""}. It doesn't matter if I'm logged into chrome or not.

Here is my permissions from my manifest:

"permissions": [
    "activeTab",
    "storage",
    "identity", //determines authorization status
    //"notifications",
    "tabs",
    "offscreenTabs",
    "http://*/",
    "https://*/"
],

Here is the relevant code:

chrome.identity.getProfileUserInfo((userInfo) => {
    debugger;
});

Thanks!


回答1:


According to the documentation the id should always be available when the user is logged in. This doesn't seem to be the case for some reason. Adding the "identity.email" permission does fix the missing id issue.

As of M41+ the documentation indicates that to get id that email permission is required.



来源:https://stackoverflow.com/questions/46898503/chrome-identity-getprofileuserinfo-returns-empty-id

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!