chrome.identity.getProfileUserInfo()返回空ID [英] chrome.identity.getProfileUserInfo() returns empty id

查看:148
本文介绍了chrome.identity.getProfileUserInfo()返回空ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道这是否仅是开发问题,因为我尚未发布扩展程序. getProfileUserInfo()返回{email:",id:"}.不管我是否登录chrome都没关系.

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.

这是我清单中的权限:

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

以下是相关代码:

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

谢谢!

推荐答案

根据文档,当用户登录时,id应该始终可用.出于某些原因,似乎并非如此.添加"identity.email"权限确实可以解决缺少的ID问题.

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.

从M41 +开始,该文档表明要获取ID,需要电子邮件许可.

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

这篇关于chrome.identity.getProfileUserInfo()返回空ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆