Chrome extension identity.email empty

前端 未结 2 722
失恋的感觉
失恋的感觉 2020-12-03 22:26

I am trying to get email and id of user through chrome identity api.

I am doing this

  chrome.identity.getProfileUserInfo(function(userinfo){
    con         


        
相关标签:
2条回答
  • 2020-12-03 22:57

    In addition to having the identity.email permission, as posted in the related Chrome issue for this subject, users must have their profile syncing turned on under chrome://settings -> People -> Sync for their ID and email to show up using chrome.identity.getProfileUserInfo.

    0 讨论(0)
  • 2020-12-03 23:08

    The getProfileUserInfo documentation says:

    • email: Empty if the user is not signed in or the identity.email manifest permission is not specified.
    • id: Empty if the user is not signed in or (in M41+) the identity.email manifest permission is not specified.

    Edit manifest.json to include both permissions:

    "permissions": ["identity", "identity.email"]
    
    0 讨论(0)
提交回复
热议问题