0

We have a Chrome extension, which is used mainly on Chromebooks and heavily relies on retrieving the user's e-mail address via chrome.identity.getProfileUserInfo. This works most of the time, but I've noticed that at random times among our customers it returns an empty field instead. Obviously I have all the required permissions in the manifest and I unfortunately haven't been able to reproduce the issue myself, nor have I noticed any patterns of when it occurs.

I'm wondering if anyone else has had similar experiences with this function.

rok
  • 557
  • 4
  • 20
  • Could it be that users are not signed into Chrome or signed with a different account? [Documentation](https://developer.chrome.com/extensions/identity#method-getProfileUserInfo) says: "The information returned is available offline, and **it only applies to the primary account for the profile**" – Iván Nokonoko Apr 10 '17 at 15:19

1 Answers1

1

In addition to @Iván Nokonoko's comment, also based from the same documentation, email is empty if the user is not signed in or the identity.email manifest permission is not specified.

Reference: Chrome extension identity.email empty

Edit manifest.json to include both permissions:

"permissions": ["identity", "identity.email"]

Hope this helps!

Community
  • 1
  • 1
abielita
  • 13,147
  • 2
  • 17
  • 59
  • As mentioned in my original post, I already have all required permissions. Fact is the function works fine in 90%+ cases, it just randomly returns empty fields every now and then. I guess it's something related to the other case mentioned in the docs, but I can't figure out what and how. – rok Apr 11 '17 at 07:36
  • only returns values if chrome sync is turned on... – Phaneendra Charyulu Kanduri Sep 23 '19 at 12:18